Re: Find and Find Next
- From: Marshall Barton <marshbarton@xxxxxxxxxx>
- Date: Mon, 05 Nov 2007 17:14:01 -0600
Rob wrote:
I have a form that pulls multiple records based on a combo box and the
records are displayed in the form. The user then proceeds to enter data. I
want to set up as part of my closing of the form a find record that matches
certain criteria and the cursor goes to that record. The criteria is
"ChkUnaccept = Yes and TxtOccur = 0". The user corrects the error and then
clicks the close button to see if there are any others. If there are then
the cursor goes to the next record where this occurs until it doesn't find
any more and then a macro is run. I just need the code to have the record
found until it goes to the End of the form and finds no records.
First, you need to save any changes to the current record.
Then you can use the FindFirst (DAO) or Find (ADO) method to
check the form's records.
The form's Unload event would look like:
If Me.Dirty Then Me.Dirty = False
With Me.RecordsetClone
.FindFirst "ChkUnaccept = Yes And TxtOccur = 0"
If Not .NoMatch Then
Cancel = True 'prevent form from closing
Me.Bookmark = .Bookmark
Enf If
End With
--
Marsh
MVP [MS Access]
.
- Prev by Date: Re: AAARGH!!! Help needed with misbehaving form link criteria
- Next by Date: RE: open a subform or hide it based on query results
- Previous by thread: RE: Find and Find Next
- Next by thread: Re: open a subform or hide it based on query results
- Index(es):
Relevant Pages
|