multi field recordset error

  • Thread starter Thread starter bob
  • Start date Start date
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
 
Hi,


Answered in microsoft.public.access.forms.


Please, do not multipost... at least, try cross-posting (in a limited
way, posting ONE message to many ng) rather than posting the same message
many times in multiple ng.



Vanderghast, Access MVP
 
Back
Top