error 3061 too few parameters, expected 5? (1 Viewer)

Bigmo2u

Registered User.
Local time
Today, 01:19
Joined
Nov 29, 2005
Messages
200
Here is the code:

Code:
With db
                               
    .Execute "INSERT INTO tblCurrentLocation (SerialNumberID, SiteLocationID, ZoneID, SectionID, RowID, BayID, clDate, clTime) " & _
             "VALUES('" & ssn & "', sli, zid, sid, rid, bid, #" & cld & "#, #" & clt & "#)"

End With

there are more than 5 parameters, I was having issues before thei with the date fields.

form that is passing these variables are set to what they are suppose to be on the form.
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 23:19
Joined
Aug 30, 2003
Messages
36,132
There are 5 values (variables?) not concatenated into the string as the others are. ;)
 

Bigmo2u

Registered User.
Local time
Today, 01:19
Joined
Nov 29, 2005
Messages
200
okay, I kind of get what you ar elooking at. I have 5 number fields, 1 string and 2 date/time fields. So what am I doing wrong?
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 23:19
Joined
Aug 30, 2003
Messages
36,132
All of the values need to be concatenated into the string. You have correctly surrounded date values with #, the text value with '. Numeric values don't need a delimiter, but still need to be concatenated.

"VALUES('" & ssn & "', " & sli & ",..."
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 23:19
Joined
Aug 30, 2003
Messages
36,132
No problem; post back if you get stuck.
 

Users who are viewing this thread

Top Bottom