Synchronizing two forms

G

Guest

I'm looking for a proper way to do something that i think is probably simple.

Lets say frmA has cboA, whose AfterUpdate event is used to populate the
form. Similarly, frmB has cboB, whose AfterUpdate event is used to populate
the form.

Code ensures that both forms are either open or both closed. (I have a
reason for doing this on two forms instead of one) As well, cboA and cboB
have exactly the same records to choose from.

Here is what I want to do: If the user changes the selection in cboA, I need
this change reflected in cboB as well. In addition, the AfterUpdate code for
both cboA and cboB would have to run to synchronize the populating of both
forms. If the user changes cboB, the mirror image process should happen.
This ought to be easy, but I'm messing up my syntax somehow. How should i
proceed?

thanks
 
M

Marshall Barton

Victoria said:
I'm looking for a proper way to do something that i think is probably simple.

Lets say frmA has cboA, whose AfterUpdate event is used to populate the
form. Similarly, frmB has cboB, whose AfterUpdate event is used to populate
the form.

Code ensures that both forms are either open or both closed. (I have a
reason for doing this on two forms instead of one) As well, cboA and cboB
have exactly the same records to choose from.

Here is what I want to do: If the user changes the selection in cboA, I need
this change reflected in cboB as well. In addition, the AfterUpdate code for
both cboA and cboB would have to run to synchronize the populating of both
forms. If the user changes cboB, the mirror image process should happen.
This ought to be easy, but I'm messing up my syntax somehow. How should i
proceed?


Strange thing to do, but that's up to you.

The first thing to do is to move the code that populates the
form to a separate Public procedure (named PopulateMe) in
its form module.

cboA's AfterUpdate event would be like:

PopulateMe
Forms!frmB.cboB = Me.cboA
Forms!frmB.PopulateMe

similarly for cboB
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top