How would you get field names using VBA? I want to do this so that I can create a custom query builder that end users can use via a form. i have the table part of it.
Function ShowTables()
Dim mytables As TableDefs
Dim currenttable As TableDef
Dim currentfields As Fields
Set mytables = CurrentDb.TableDefs
For Each currenttable In mytables
If Left(currenttable.Name, 3) = "Tbl" Then
MsgBox currenttable.Name
End If
Next currenttable
End Function
Now I'm just wondering how to get the field names for these tables. Any help would be appreciated. Thanks
Function ShowTables()
Dim mytables As TableDefs
Dim currenttable As TableDef
Dim currentfields As Fields
Set mytables = CurrentDb.TableDefs
For Each currenttable In mytables
If Left(currenttable.Name, 3) = "Tbl" Then
MsgBox currenttable.Name
End If
Next currenttable
End Function
Now I'm just wondering how to get the field names for these tables. Any help would be appreciated. Thanks