B
bob
I am getting closer. Now the error I am getting is
that ....at line db.execute...
and the error is runtime'3061'
Too few parameters . Expected 1.
Also, my question is I am not doing anything wrong here in
creating the recordset right? I mean I can createa
Recordset from a form where some fields are bound and the
others are unbound.
For my fields....
Studentclocknum is text
Shours is numbers
programcode is text
cnme is text
logintime is date
logout is date
exempt is a text...a check box?
my syntax is right?
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,exempt,
shours) " & _
"Values (" & _
.Fields("StudentClockNum") & ", " & _
Me!ProgCode & ", " & _
Me!CNum & ", " & _
Me!Check60 & "," & _
.Fields("thours") & _
");"
db.Execute strsql, dbFailOnError
..MoveNext
Loop
End With
Set db = Nothing
End Sub
that ....at line db.execute...
and the error is runtime'3061'
Too few parameters . Expected 1.
Also, my question is I am not doing anything wrong here in
creating the recordset right? I mean I can createa
Recordset from a form where some fields are bound and the
others are unbound.
For my fields....
Studentclocknum is text
Shours is numbers
programcode is text
cnme is text
logintime is date
logout is date
exempt is a text...a check box?
my syntax is right?
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,exempt,
shours) " & _
"Values (" & _
.Fields("StudentClockNum") & ", " & _
Me!ProgCode & ", " & _
Me!CNum & ", " & _
Me!Check60 & "," & _
.Fields("thours") & _
");"
db.Execute strsql, dbFailOnError
..MoveNext
Loop
End With
Set db = Nothing
End Sub