Link to home
Start Free TrialLog in
Avatar of Jeremy Campbell
Jeremy CampbellFlag for United States of America

asked on

How to loop through records and select matching record in access form vba?

I just need to be able to loop through the records of a query and if they meet the criteria then select the record on the form and unhide the form.

Here is what I'm thinking the code may look like based on some googling;

Private Sub Form_Timer()

Me.Requery

<<Loop code here ....if fOSUserName() = Me.UserName Then (need to incorporate this criteria)>>

Me.Form.Visible = True


End If


End Sub



I have looked up loops through google but really am not sure exactly how to set it up.. The forms datasource is the source that needs be looped through.. [qryNotifications]

Thanks a ton for the help!
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jeremy Campbell

ASKER

Does the trick perfectly! Thanks!