Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

insert query

Status
Not open for further replies.

GK22

Programmer
Jan 22, 2002
35
0
0
NL
I can't find out what is wrong with the statement:
sql = "INSERT INTO OPMERKING_PR([gemaakt door], [datum], [notitie]," & _
"[ leadnummer],[werknummer], [navolging]) SELECT " & _
"str1, str2, str3, str4, str5, str6;"
DoCmd.RunSQL sql

str'X' compares with controlboxes in the form, just like
str1 = me.textbox1.value, i.g.

thanx in advance
Gerard
 
What results/error do you get? Does the data violate any of your table constraints? JHall
 
No violate data
Syntaxis error, but I don't know what's wrong
Do you know what syntaxiserror it can be?
 
I'm not sure. Syntax looks okay for ANSI SQL, does Jet require you to use a VALUES clause? Is there a space in front of your [ leadnummer] column? JHall
 
the space was there ;))
don't ask for a values clause, but I do

select values (and so on) and now it's ok

one thing, there was an error, query fields and targetfields are not in the same order (error 3346) but when I "acdataerrcontinue and so on" it seems good
thanx a lot
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top