J
Jerad via AccessMonster.com
Okay, heres my Problem. I need to create indexes on multiple fields in
multiple tables. These fields and table names are static, but i'd like to use
my variables for table names and field names in the SQL statement. Heres my
code, so far
Public Sub tryIndexing()
Dim sqlDeal As String
Dim strFieldName As String
Dim strTableName As String
strTableName = "tableOne"
strFieldName = "fieldOne"
sqlDeal = "CREATE INDEX " & strFieldName & " on " & strTableName & "(" &
strFieldName & ");"
DoCmd.RunSQL (sqlDeal)
End Sub
Now i need to create index for fieldTwo and fieldThree and then (tableTwo,
fieldOne and FieldTwo Ect.)
Im not sure how to go about looping this to change these variables each loop.
Any help appreciated,
Thanks in advance.
Jerad
multiple tables. These fields and table names are static, but i'd like to use
my variables for table names and field names in the SQL statement. Heres my
code, so far
Public Sub tryIndexing()
Dim sqlDeal As String
Dim strFieldName As String
Dim strTableName As String
strTableName = "tableOne"
strFieldName = "fieldOne"
sqlDeal = "CREATE INDEX " & strFieldName & " on " & strTableName & "(" &
strFieldName & ");"
DoCmd.RunSQL (sqlDeal)
End Sub
Now i need to create index for fieldTwo and fieldThree and then (tableTwo,
fieldOne and FieldTwo Ect.)
Im not sure how to go about looping this to change these variables each loop.
Any help appreciated,
Thanks in advance.
Jerad