Full Version: Form.load Event Do To Until
UtterAccess Forums > Microsoft® Access > Access Forms
pensived
Hi Everyone,
I have a form that tracks projects. When the project is complete, a check box is clicked. In the On Load Event, I have the following code. BUT it only skips to the second "closed" record, which I know I'm asking it to, I would like it to find the first record where me.closedchk = false and stop there. I can't filter out the closed projects, which would be easy, because we still need to be able to scroll to them if required.



If Me.ClosedChk = True Then
DoCmd.GoToRecord , , acNext
End If

Any Ideas??

As always, Thank you
theDBguy
Hi,

You could try using the FindFirst method of the form's Recordset object. For example, try:

Me.Recordset.FindFirst "ClosedChk=True"
pensived
Thank you Sir!! that was exactly what I needed. Thank you for the direction!



If Me.ClosedChk = True Then

With Me.RecordsetClone
.FindFirst "ProjectClosed = false"
Me.Bookmark = .Bookmark
End With
End If
theDBguy
Hi,

Glad to hear you got it sorted out. Good luck with your project.
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.