SQL string

K

kon

How can I insert into a table value witch is
for example 12,3 while it takes it as 2 different values in a sql string (I
don't wont the value to converted to string but keep is as double)

Thank in advace
 
K

Ken Snell \(MVP\)

Show us what you're trying to use now. That will help us see what you're
doing and what might need to be changed.
 
K

kon

Dim codecustomer, sqlstring As String
codecustomer = rslist.Fields("code")
sqlstring = " INSERT INTO difference ( custcode, residual,
total ) values ('" & codecustomer & "'," & residual & "," & total & ")"
DoCmd.RunSQL sqlstring
Residual or total might be 12,2 so it takes as 2 values
How can I change my sqlstring to bypass the problem?
 
K

Ken Snell \(MVP\)

Enclose the values inside ' characters:

sqlstring = " INSERT INTO difference ( custcode, residual,
total ) values ('" & codecustomer & "', '" & residual & "', '" & total &
"')"
 
Top