AfterOpenProject事件,写代码
DataTables("安全检查明细表").DataCols("照片").DefaultFolder = ProjectPath & "检查照片\"
修改你原来的代码
If e.DataCol.Name = "照片" Then
Dim dr As DataRow = e.DataRow
If dr.IsNull("检查人") Or dr.IsNull("检查日期") Then
MessageBox.Show("检查人和检查日期不能为空!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
e.Cancel = True
Else
e.SubFolder = e.DataRow("房屋地址") & "\" & dr("检查日期").Date & dr("检查人")
End If
End If