R
rebelscum0000
Tbls : Table
Fields:
Id
Table
Include
Hello Group, I need to Move the list of all tables in the Current Dbs
to another tlb
Called Tbls in the same Current Dbs My code is as follows:
Sub All_Tables_SMU_II()
'This Code list all the Tables in the Current Database
Dim aob As AccessObject
Dim Counter As Variant 'Counter *
'Initialize variables
Counter = 0
'CurrentData is the object that contains the tables
For Each aob In CurrentData.AllTables
Counter = Counter + 1
If Left$(aob.Name, 4) <> "MSys" Then
MyTableName = aob.Name
MsgBox MyName
Tables_AllTbls = aob.Name
MsgBox "Obj #" & Counter_AllTbls & " " & Tables_AllTbls
'SQLStatement
SQL2 = "INSERT INTO Tbls ? & _
" SELECT ? & _
" FROM ? " & _
" WHERE ?
" ORDER ?
DoCmd.RunSQL SQL2
End If
Next aob
End Sub
----> My Problems and Questions--->
1.- I need to change this code as DAO Recordest
2.- I need to update The Counter, MyTableName and ORDER from the
Counter in the SQLStatement
3.- I do not have any idea how will be the sintaxys of the SQLStatement
for this code
Thank you very much in advance
Regards
Antonio Macias
Fields:
Id
Table
Include
Hello Group, I need to Move the list of all tables in the Current Dbs
to another tlb
Called Tbls in the same Current Dbs My code is as follows:
Sub All_Tables_SMU_II()
'This Code list all the Tables in the Current Database
Dim aob As AccessObject
Dim Counter As Variant 'Counter *
'Initialize variables
Counter = 0
'CurrentData is the object that contains the tables
For Each aob In CurrentData.AllTables
Counter = Counter + 1
If Left$(aob.Name, 4) <> "MSys" Then
MyTableName = aob.Name
MsgBox MyName
Tables_AllTbls = aob.Name
MsgBox "Obj #" & Counter_AllTbls & " " & Tables_AllTbls
'SQLStatement
SQL2 = "INSERT INTO Tbls ? & _
" SELECT ? & _
" FROM ? " & _
" WHERE ?
" ORDER ?
DoCmd.RunSQL SQL2
End If
Next aob
End Sub
----> My Problems and Questions--->
1.- I need to change this code as DAO Recordest
2.- I need to update The Counter, MyTableName and ORDER from the
Counter in the SQLStatement
3.- I do not have any idea how will be the sintaxys of the SQLStatement
for this code
Thank you very much in advance
Regards
Antonio Macias