Why this error

G

Guest

Hi
in a function i have this code
If Not rs.EOF Then
Dim db3 As DAO.Database
Dim rs3 As DAO.Recordset
Set db3 = CurrentDb()
Set rs3 = db.OpenRecordset("tilmelding")
rs3.Index = "kursusplanid"
rs3.Seek "=", rs2("kursusplanid")

rs3.Edit
rs3("kundenr") = rs("kundenummer")
rs3.Update

rs3.Close
End If
it works fine
now in another function i have this:
Dim db3 As DAO.Database
Dim rs3 As DAO.Recordset
Set db3 = CurrentDb()
Set rs3 = db.OpenRecordset("tilmelding")

rs3.Edit
rs3("kundenr") = 1
rs3.Update

rs3.Close
here i get an error on
Set rs3 = db.OpenRecordset("tilmelding")
the error is:
run time error 424
objecet required

i don't understand this ?

Alvin
 
G

Guest

Set rs3 = db.OpenRecordset("tilmelding")
should be
Set rs3 = db3.OpenRecordset("tilmelding")
 

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