Easy problem...sql ms access

jkainth

New member
Local time
Today, 05:57
Joined
Oct 28, 2004
Messages
8
ms access
I have a empty table called ...'Table2' with 3 fields 'firstname', 'lastname', 'value'
i have another table called ...'Table1' with 2 fields 'firstname', 'lastname'
i have form with a textbox callled Text0

this is the query that i am having trouble with:

INSERT INTO Table2 SELECT Table1.firstname, Table1.lastname, Forms!Form1!Text0.text FROM Table1;

the query doesnot run, gives an error. The SELECT query works stand alone but not when in above. i think well know that the problem is to do with the data from the form

P.S someone will ask me if the form was open and had a value and that it was open before the query was run...and the answer is yes
 
j,

Code:
DoCmd.RunSql "INSERT INTO Table2 " & _
             "SELECT firstname, " & _
             "       lastname, " & _
             "'" & Forms!Form1!Text0 & "' " & _
             "FROM Table1"

Works OK if only one row in Table1.

Wayne
 

Users who are viewing this thread

Back
Top Bottom