B
bob
I am having a problem when I am running this code. It
works fine with one field but when I am putting all the
three fields at a time it is creating a problem...
the error is pointing to the statement...insert into...
and the message is..
Compile error:
Wrong number of argumentsor invalid property assignment.
Private Sub Command46_Click()
Dim db As Database
Dim rs As Recordset
Dim strsQl As String
Set rs = Me.RecordsetClone
Set db = CurrentDb
rs.MoveFirst
Do Until rs.EOF
strsQl = _
"Insert into tblattendance
(StudentClockNum,programcode,coursenum) values (" & _
rs.Fields("StudentClockNum", "progcode", "cnum") & ");"
db.Execute strsQl, dbFailOnError
rs.MoveNext
Loop
Set rs = Nothing
Set db = Nothing
End Sub
works fine with one field but when I am putting all the
three fields at a time it is creating a problem...
the error is pointing to the statement...insert into...
and the message is..
Compile error:
Wrong number of argumentsor invalid property assignment.
Private Sub Command46_Click()
Dim db As Database
Dim rs As Recordset
Dim strsQl As String
Set rs = Me.RecordsetClone
Set db = CurrentDb
rs.MoveFirst
Do Until rs.EOF
strsQl = _
"Insert into tblattendance
(StudentClockNum,programcode,coursenum) values (" & _
rs.Fields("StudentClockNum", "progcode", "cnum") & ");"
db.Execute strsQl, dbFailOnError
rs.MoveNext
Loop
Set rs = Nothing
Set db = Nothing
End Sub