recordset error 3061

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
 
D

Douglas J. Steele

Try putting a Debug.Print strsql in your code to see exactly what the SQL
looks like.
 
V

Van T. Dinh

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top