synchronize two forms

H

hngo

Hi,

I have two forms one bound & one unbound. The unbound form is used to
display the bounded form records in form format. My problem is that the
unbound form only display the record during initial opening after that even
you select a different record on the bound form the unbound form record does
not change

please help

many thanks
 
D

David Cleave

Hi there

You need to set the bound form to copy its values across to the unbound form
whenever the bound form changes to a new record.

Create a routine from the bound form's OnCurrent event. (The OnCurrent event
occurs whenever you change to a new record, or when the form opens.) Do this
by going into the bound form's properties, clicking the Events tab, selecting
the box saying 'OnCurrent', clicking the little button with the three dots,
and choosing 'Code Builder'.

In between the Sub and End Sub lines, type what you want to happen when you
change record. To copy the value from Text Box 1 in Form 1 to Text Box 1 in
Form 2, type the following:

[Forms]![Form 2]![Text Box 1] = [Forms]![Form 1]![Text Box 1]

Repeat for all the other controls on the form.

You might also want to update a control on the unbound form whenever the
corresponding control on the bound form is changed. You will need the
control's AfterUpdate event for this.

Hope this helps

David
 
Top