Auto select other options when one is selected.

benjihubbs

New member
Local time
Today, 13:38
Joined
Sep 26, 2012
Messages
4
Hi everyone,

This is my first post, so be kind please :)

I'm creating a diary database which has names and addresses, I want it to automatically select the address of the person who is selected in the first drop down box. At the moment all it will let me do is select the address from a list of addresses.

Can anyone help?

Thanks
Ben
 
Do you have the names in the same table on the same row? How have you created the Combo Box? What fields are on the Form? If you use the combo on the Form is it to find a record?
 
I'm not an expert around here, but I've done this a couple of times.

1) Your address field should be a combo box.

2) Go to the "Row Source" property and hit the button to edit it. It will bring up a query window.

3) Bring down the address field (I'll call it "Address") and name field ("Name").

4) Under the criteria for "Name", enter [Forms]![Your_Form_Name]![Name].

5) Uncheck the "show" checkbox in the "Name" field so it doesn't show up in your box.

6) Exit and save the query.

Now it'll work fine and only let you select the correct address. For it to automatically pop up you need to add some code to the "Name" field.

7) Go to the AfterUpdate event on the "Name" field and click on the button to the right to edit it. Go to the Code Builder when it prompts you.

8) Enter:
Me.Address.Requery
Me.Address = Me.Address.ItemData(0)

9) Save and exit.

I think that'll do what you want...hopefully I didn't miss any steps.
 

Users who are viewing this thread

Back
Top Bottom