updating combobox in subform based on value in mainform

T

tomagneessens

Hi all, and tx in advance for any help !!

So here it goes :

I have a mainform with adresses and 1 dropdown. What is shown in that
mainform is dependant of the choise in 1st dropdown (location). This
works OK.

In that mainform I have a tabcontrol with in one of the tabs a 2nd
form.

That second form has its own dropdown.

The second form is supposed to show for example doctors for A
specifique location choosen in dropdown 1. And that works OK.

I'm only showing one Docter at the time in that second form (but there
are more than one doctors for one location).

I want to have a list of ALL doctors for ONE SPECIFIC location in that
second dropdown.

I can't get that to work. Now, the second dropdown shows all doctors
without taking the location (from dropdown 1) into account.

How can I resolve this ?

Kind regards
 
M

Michel Walsh

Hi,


For a list? You can use the syntax FORMS!FormName!ControlName in the
RowSource:


ControlName.RowSource="SELECT .... WHERE somefield =
FORMS!FormName!ControlName"


You don't need to use any 'delimiter' around that reference.

You have to re-execute that statement if the FORMS!FormName!ControlName
value has changed. Since this is a list behind the combo box, you can wait
until the combo box get the focus, most of the time.


Hoping it may help,
Vanderghast, Access MVP
 

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