syntax error in string in query expression '45')

bndck

New member
Local time
Today, 11:27
Joined
Jan 20, 2011
Messages
1
[FONT=Verdana, Arial, Helvetica]Hi,,
I tried to access database from VB6 n ended up this error
my all SELECT statement,reports work fine. This statement doesn't work

This is my statement which gives me error as "syntax error in string in query expression '45')"

Con.Execute "INSERT INTO Sold_Products_Temp(Date_sold,Product_Code,Description,Sold_rolls,Sold_mts,Category) VALUES (#" & DTPicker1.Value & "#,'" & Text1(0).Text & "','" & Text1(1).Text & "'," & toNumber(Text1(5).Text) & "," & toNumber(Text1(6).Text & " ,'" & Text1(4).Text) & "')"

can anyone suggest solution plz.

many thanks
[/FONT]
 
The only time you can use .text is when the control has the focus. Remove this syntax and retry.
 
bndck - It looks like you are adding single quotes to a field which is expecting a number (the place where you are getting the number 45). Remove the quotes and try again.
 

Users who are viewing this thread

Back
Top Bottom