UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> CREATE TABLE    
 
   
BartHughes
post Aug 14 2004, 05:23 PM
Post #1

New Member
Posts: 10



I am making a copy of one of my tables. The following code produces a syntax error. Can someone enlighten me? (IMG:http://www.utteraccess.com/forum/style_emoticons/default/frown.gif)

Thanks,
Bart

CREATE TABLE Inputs_StationaryInputs SELECT * FROM Inputs_LinkedInputs;
Go to the top of the page
 
+
R. Hicks
post Aug 14 2004, 05:28 PM
Post #2

UA Forum Administrator
Posts: 38,073
From: Birmingham, Alabama USA



Hmmmm ....

Try:
CODE
SELECT Inputs_LinkedInputs.* INTO Inputs_StationaryInputs
FROM Inputs_LinkedInputs;

RDH
Go to the top of the page
 
+
BartHughes
post Aug 14 2004, 05:35 PM
Post #3

New Member
Posts: 10



That's the route I was down earlier, but I get the error message "Invalid Operation".
Go to the top of the page
 
+
R. Hicks
post Aug 14 2004, 05:38 PM
Post #4

UA Forum Administrator
Posts: 38,073
From: Birmingham, Alabama USA



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 ...

RDH
Go to the top of the page
 
+
BartHughes
post Aug 14 2004, 05:42 PM
Post #5

New Member
Posts: 10



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)
Go to the top of the page
 
+
R. Hicks
post Aug 14 2004, 05:47 PM
Post #6

UA Forum Administrator
Posts: 38,073
From: Birmingham, Alabama USA



This should be all you need ....
CODE
Dim strSQL As String



strSQL = "SELECT Inputs_LinkedInputs.* " & _

"INTO Inputs_StationaryInputs " & _

"FROM Inputs_LinkedInputs;"

  

CurrentDb.Execute strSQL, dbFailOnError

RDH
Go to the top of the page
 
+
BartHughes
post Aug 14 2004, 05:57 PM
Post #7

New Member
Posts: 10



that's the ticket. Thanks!

Bart

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?


http://www.utteraccess.com/forums/showflat...;o=&fpart=1
Go to the top of the page
 
+
R. Hicks
post Aug 14 2004, 05:59 PM
Post #8

UA Forum Administrator
Posts: 38,073
From: Birmingham, Alabama USA



You are very Welcome ... (IMG:http://www.utteraccess.com/forum/style_emoticons/default/frown.gif)

Just looked at the other post ... I haven't a clue ...

RDH

Edited by: R. Hicks on 08.14.04.
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 21st May 2013 - 07:57 PM