change form content according to combo ie home/work address

hjgwright

Registered User.
Local time
Today, 01:41
Joined
Jul 11, 2002
Messages
14
Hi.
I have a form with personal details, and a combo - combo21.
This has Home Address and Work Address as its data (from Address Type table).
However, when you click on either Home Address or Work Address it just stays at the same field. You can move to the next record to see a Home Address though.

I need to be able to bring up only those records with Address Type "Home Address" when I select Home Address in the Combo box.

The same is needed for the Work Address.

Thanks,
HW.
 
Last edited:
HW,

Not sure I understand the problem, but here's something to try: In the Home/Work combo box's AfterUpdate event, do something like

Me.Filter = "AddressType = """ & combo21 & """"
Me.FilterOn = True

then

Me.Requery ' To apply the new filter

This will set the filter for the form to the character-type value of the combo box. (If the combo box is a table index - long integer type - omit the parentheses around combo21 when setting the filter.)

If this does the job, put the following into the Form's OnOpen event:

Call combo21_AfterUpdate

to set the filter when the form is opened.

Jim
 

Users who are viewing this thread

Back
Top Bottom