yippie_ky_yay
Registered User.
- Local time
- Today, 02:57
- Joined
- Jul 30, 2002
- Messages
- 338
Hello forum,
I am obviously still confused with the whole ADO/DAO thing! For this experiment, I'm trying to loop through all the records in my tblPersonal table and display the message "Hey" for each record.
Looking through this forum I always see references to the DAO type (I do know about registering the library). Something always fails on me though. I tried:
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim x As Integer
Set db = currentdb
For x = 1 To rs.RecordCount
MsgBox ("Hey")
Next x
End Sub
(this code is tied to a clickable button on a form - the recordsource for the form is all the records from tblPersonal).
I get: "Object variable or With block variable not set" to anything I try placing after "rs."
Anything obvious I'm doing wrong? Is there a reason all examples I've found on this subject have been in DAO?
Thanks in advance,
-Sean
I am obviously still confused with the whole ADO/DAO thing! For this experiment, I'm trying to loop through all the records in my tblPersonal table and display the message "Hey" for each record.
Looking through this forum I always see references to the DAO type (I do know about registering the library). Something always fails on me though. I tried:
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim x As Integer
Set db = currentdb
For x = 1 To rs.RecordCount
MsgBox ("Hey")
Next x
End Sub
(this code is tied to a clickable button on a form - the recordsource for the form is all the records from tblPersonal).
I get: "Object variable or With block variable not set" to anything I try placing after "rs."
Anything obvious I'm doing wrong? Is there a reason all examples I've found on this subject have been in DAO?
Thanks in advance,
-Sean