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
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