Need help with Recordset data.

domoputro

Registered User.
Local time
Today, 13:56
Joined
Apr 2, 2003
Messages
11
How do you set the rs in the code below?
The source data for my Form comes from a query.

I want this function to go the next record in the form until the end of file.

Public Function AllocateMonth()
Dim rs As Recordset
Do While Not rs.EOF
if me.Start ...
...
...
...
rs.MoveNext

Loop
End Function



Thanks...
 
Dim rstRecordset as Recordset (Make sure ADO is in the reference's list)


Set rstRecordset = CurrentDb.Openrecordset("SELECT Field1, Field2 (ETC) FROM Table1 (OPTIONAL: WHERE Field1=X);",dbOpenDynaset)


Refer to the fields in the recordset as:
rstRecordset!Field1
(AFTER MOVING TO THE FIRST RECORD (IF ANY))
 
Thanks for the prompt reply.
 

Users who are viewing this thread

Back
Top Bottom