I am making a copy of one of my tables. The following code produces a syntax error. Can someone enlighten me?
CREATE TABLE Inputs_StationaryInputs SELECT * FROM Inputs_LinkedInputs;
Aug 14 2004, 05:28 PM
SELECT Inputs_LinkedInputs.* INTO Inputs_StationaryInputs FROM Inputs_LinkedInputs;
Aug 14 2004, 05:35 PM
That's the route I was down earlier, but I get the error message "Invalid Operation".
Aug 14 2004, 05:38 PM
I have tested this and I works on my machine ...
It's just a simple Make Table Query ... and should work.
Is the table you are referencing in the current database ???
Post exactly what is returning the error you described ...
Aug 14 2004, 05:42 PM
No, I am creating it. I see now that the problem lies in the syntax of my DAO code. I ran your SQL in the query window and it worked fine. However, I am wanting to do the operation with VBA. The following code produces the error:
Dim MyDB As DAO.Database Dim MyRecSet As DAO.Recordset Dim SQLString As String
SQLString = "SELECT Inputs_LinkedInputs.* INTO Inputs_StationaryInputs FROM Inputs_LinkedInputs;" Set MyDB = CurrentDb Set MyRecSet = MyDB.OpenRecordset(SQLString)
Aug 14 2004, 05:47 PM
This should be all you need ....
Dim strSQL As String
strSQL = "SELECT Inputs_LinkedInputs.* " & _
"INTO Inputs_StationaryInputs " & _
CurrentDb.Execute strSQL, dbFailOnError
Aug 14 2004, 05:57 PM
that's the ticket. Thanks!
I think you had responded to another question I had that was double posted on the wrong group (my first post :(... ) . I received an email saying I had a response but the thread was deleted becuase of my double post. The link is below to the other question. Can you give me some pointers to go look up some info on? Is it just a recursive loop that adds locates the children and adds them?