|
本帖最后由 wx0000888 于 2016-7-1 11:42 编辑
- Private Sub getTablesListing()
- Dim strTables As String
- Dim I As Integer
- For I = 0 To CurrentDb.TableDefs.Count - 1
- If Left(CurrentDb.TableDefs(I).Name, 4) <> "MSys" Then
- strTables = strTables & CurrentDb.TableDefs(I).Name & ";" & "表" & ";"
- End If
- Next
- For I = 0 To CurrentDb.QueryDefs.Count - 1
- strTables = strTables & CurrentDb.QueryDefs(I).Name & ";" & "查询" & ";"
- Next
- If Len(strTables) Then
- strTables = Left(strTables, Len(strTables) - 1)
- Me.ListTables.RowSource = strTables
- End If
- End Sub
复制代码 把ListTables 列数设成两列.- Private Sub ListTables_AfterUpdate()
- On Error GoTo Err_ListTables
- Dim strFields As String
- Dim strFields1 As String
- Dim rst As Recordset
- <p> Dim I As Integer</p><p>
- </p><p> Me.ComboFields.RowSource = ""</p><p> Me.List29.RowSource = ""
- </p> Set rst = CurrentDb.OpenRecordset(Me.ListTables)
- For I = 0 To rst.Fields.Count - 1
- '11 OLE 对象,二进制字段
- If rst.Fields(I).Type <> 11 Then
- strFields = strFields & rst.Fields(I).Name & ";" & rst.Fields(I).Type & ";"
- strFields1 = strFields1 & rst.Fields(I).Name & ";"
- End If
- Next
- If Len(strFields) Then
- strFields = Left(strFields, Len(strFields) - 1)
- End If
- Me.ComboFields.RowSource = strFields
- Me.List29.RowSource = strFields1
- Me.ListTables.ControlTipText = Me.ListTables
- Exit_ListTables:
- Set rst = Nothing
- Exit Sub
- Err_ListTables:
- If Err.Number <> 3078 Then MsgBox Error
- Resume Exit_ListTables
- End Sub
复制代码 代码优化加快速度
把附件传上来, 至于楼主的要求或达到什么目的俺实在没看懂其意思, 不知从何帮起. ....
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|