Hello I am just trying to learn how to loop through records.
I am trying to do a very basic task to start with.
I have a form and would like to loop through the records and show a message box with the ID for each record.
My code seems to loop through the records, but the ID stays the same throughout - I'm not sure why.
In addition should I be trying to loop through records on the form or by using a recordset? Many thanks for any pointers, Mark
I am trying to do a very basic task to start with.
I have a form and would like to loop through the records and show a message box with the ID for each record.
My code seems to loop through the records, but the ID stays the same throughout - I'm not sure why.
In addition should I be trying to loop through records on the form or by using a recordset? Many thanks for any pointers, Mark
Code:
Set rst = Me.RecordsetClone ' I'm guessing this copies the recordset
rst.MoveFirst ' I'm guessing this moves to the first record of the recordset
Do Until rst.EOF ' I'm guessing says run the code until there are no more records
MsgBox "Here is the property number:" & [Prop_ID]
rst.MoveNext ' I'm guessing says go to the next record
Loop