'切换主表时,使光标停留在第一个单元格上
With MainTable
If .Rows.Count > 0 Then
For Each cl As Col In .cols
If cl.visible Then
.Select(0,.cols(cl.name).index) '这是定位在第一行
Exit For
End If
Next
End If
End With
Select Case MainTable.Name
Case "TbBuider"
MainTable.Filter = "ProID = '" & SoftProID & "' and SysAdd = 0 "
Case "TbMatStore"
Dim dmp As New TableDataMap
dmp.DataTable = "TbStorage" '指定数据来源表
dmp.ValueCol = "ID" '指定取值列
dmp.DisplayCol = "Title" '指定显示列
'指定下拉列表时显示哪些列的数据
dmp.ListCols = "Code,Title,Address,Head"
dmp.Sort = "Code" '指定排序方式
dmp.Filter = "SysAdd = 0 "
Tables("TbMatStore").Cols("StorageID").DataMap = dmp.CreateDataMap() '生成并设置DataMap
Case "TbConFM"
Dim dmp As New TableDataMap
dmp.DataTable = "TbCon" '指定数据来源表
dmp.ValueCol = "ID" '指定取值列
dmp.DisplayCol = "Title" '指定显示列
'指定下拉列表时显示哪些列的数据
dmp.ListCols = "Code,Title,YouTitle"
dmp.Filter = "ConType = 2 "
dmp.Sort = "" '指定排序方式
Tables("TbConFM").Cols("ConID").DataMap = dmp.CreateDataMap() '生成并设置DataMap
End Select