C
Craig
I'm using Access 2003. When I run the sub below I get the following error
message: "Compile error. Wrong number of arguments or improper property
assignment."
I'm trying to append about 50 tables through vba to a table called "tblAll".
I don't know what the issue is. The code is as follows:
Sub AppendTables()
Dim db As Database, rs As Recordset, i As Integer
Set db = CurrentDb()
Set rs = db.OpenRecordset("qry_Table_Names")
rs.MoveFirst
Do While Not rs.EOF
DoCmd.RunSQL "INSERT INTO tblAll ( Field1, Field2, Field3) SELECT " &
rs("Name") & ".[Field1]", rs("Name") & ".[Field2]" & rs("Name") & ".[Field3]"
& " FROM " & rs("Name") & ";"
rs.MoveNext
Loop
MsgBox "Done."
End Sub
Thanks for any and all help.
message: "Compile error. Wrong number of arguments or improper property
assignment."
I'm trying to append about 50 tables through vba to a table called "tblAll".
I don't know what the issue is. The code is as follows:
Sub AppendTables()
Dim db As Database, rs As Recordset, i As Integer
Set db = CurrentDb()
Set rs = db.OpenRecordset("qry_Table_Names")
rs.MoveFirst
Do While Not rs.EOF
DoCmd.RunSQL "INSERT INTO tblAll ( Field1, Field2, Field3) SELECT " &
rs("Name") & ".[Field1]", rs("Name") & ".[Field2]" & rs("Name") & ".[Field3]"
& " FROM " & rs("Name") & ";"
rs.MoveNext
Loop
MsgBox "Done."
End Sub
Thanks for any and all help.