Running a check on all records in a table at once

Heather99

New member
Local time
Today, 17:50
Joined
Jul 5, 2000
Messages
6
Ok, I have been running myself in circles trying to figure this out, and am hoping there is a not-too-complicated answer. (I'm not exactly an Access guru yet!)

Here is what I would like to happen:
When the database is started, or the switchboard opens, an automatic check runs that checks a date field against the current date. If they are equal, a field in the same table updates to "Available". The combo-box that displays this field will also update on the forms.

I currently have the code attached to the form, using OnCurrent, and it works, but only when you scroll through each record. I need it to check automatically for all records. I've tried a few differnt "until EOF" type things, and nothing has quite worked. Any suggestions would be greatly appreciated!!
 
Try this:

Dim rs as Recordset
Set rs=Me.RecordsetClone
rs.MoveFirst
Do until rs.EOF

' carry out any action with rs!Field1, rs!Field2 etc.
' be sure using rs.Edit and rs.Update

rs.MoveNext

Loop
Set rs=nothing

Might be running pretty well
 
I'm sorry, but I'm still a little new to this...where exactly am I putting this code?? I'm not sure how to get it to work with the table instead of the form.

Thanks for your help.
 

Users who are viewing this thread

Back
Top Bottom