bookmark find record method breaks combo box

J

jazzaus

When I create a button on a form that opens another form and goes to a
particular record using the findfirst function and then bookmark
function the form being opened is filtered. If I then want to use that
form to go to another record by using a combo box's afterupdate event
the event does not fire until I manually click the remove filter
button. I can't turn the filteron property to false unless I can get an
evernt to fire first. I used the built-in wizard to create the code for
the bookmark lookup.

Here is the code on the first form:
-------------------------------------------------------------------
Dim stDocName As String
Dim intLeaseNumber As String

intLeaseNumber = Me.Lease_Number

stDocName = "Lease_Edit"
DoCmd.Close

DoCmd.OpenForm stDocName

Forms!Lease_Edit!Lease_Number_Select = intLeaseNumber
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[Lease_ID] = " & Str(Nz(intLeaseNumber, 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
-------------------------------------------------------------------
This works just fine and opens the second form. The DoCmd.Close does
not seem to do what I want which is close the 1st form and them open
the second form and perform the lookup. I want to only have a single
form open at a time in this database to avoid user confusion.
When this code is executed the form "Lease_Edit" is opened and the
appropriate record is displayed. On the "Lease_Edit" form the
AfterUpdate action on my combo box does not fire when a new entry is
selected from the dropdown list unless I manually remove the filter on
the form. Then my afterupdate event fires again. How can I get this to
work?
Thanks,
Joel
 
Top