recordset error 3061

  • Thread starter Thread starter bob
  • Start date Start date
B

bob

I am running this code and am getting the error....
on line db.execute...
run-time error '3061'
too few parameters
expected 1.

Can someone tell me where the mistake is???

Private Sub Command46_Click()


Dim db As DAO.Database
Dim strsql As String

Set db = CurrentDb

With Me.RecordsetClone

..MoveFirst

Do Until .EOF

'begin of the insert statement to insert the records

strsql = _
"Insert into tblattendance " & _
"(StudentClockNum,programcode,coursenum,loginti
me,logouttime,exempt,shours) " & _
"Values (" & _
.Fields("StudentClockNum") & ", " & _
Me!Text22 & ", " & _
Me!Text24 & ", " & _
Format(Me!Login, "\#mm/dd/yyyy hh:nn:ss\#")
& ", " & _
Format(Me!logout, "\#mm/dd/yyyy hh:nn:ss\#")
& ", " & _
Me!Check60 & ", " & _
.Fields("thours") & _
");"

db.Execute strsql, dbFailOnError

..MoveNext
Loop
End With


Set db = Nothing

End Sub
 
Try putting a Debug.Print strsql in your code to see exactly what the SQL
looks like.
 
You are getting confused because you posted TOO MANY
threads to TOO MANY newsgroups on the same question and
you probably didn't know which reply you have read and
tried and which reply you haven't.

Please read the netiquette and learn how to use the
newsgroups efficiently:

<http://www.mvps.org/access/netiquette.htm>

HTH
Van T. Dinh
MVP (Access)
 
Back
Top