How to synchronize two existing forms?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have two forms. The first has a button to call the second form. I want to
synchronize the records in the two forms so that when I select the next
record in the main form, the matching record in the second form is selected.
 
I have two forms. The first has a button to call the second form. I want to
synchronize the records in the two forms so that when I select the next
record in the main form, the matching record in the second form is selected.

The *simple* way to do this is to make the second form a Subform of
the first, perhaps using a Tab Control if you need the screen space.

If you really need to do it using a command button, put code in the
button's Click event to set the WhereCondition argument of the
OpenForm method to a SQL WHERE clause (without the WHERE) which will
select the desired record:

Dim strWhere As String
strWhere = "[ID] = " & Me!txtID
DoCmd.OpenForm "OtherForm", WhereCondition := strWhere


John W. Vinson[MVP]
 
Back
Top