Dependent combo box

S

scott

I've seen several posts related to this, but I don't seem to be able to get
the answer.

I have a table with people in it and another table with contact info (phone,
email, etc.) The contact info is an ID, personID that relates to the id of
the person in the first table, and contact type. Contact type is an integer
field that relates to teh ID field in a contact type table that has a list of
contact types (home phone, work phone, home email, work email, etc.).

I want to create a continuous form that has the name of the person with a
combo box that lists the contact info for the person whose record is
selected. The query I am using for the combo box that does not work is:
SELECT ContactNumber.id, ContactNumber.Number [I'll add contact type once I
get the form to work]
FROM ContactNumber
WHERE (((ContactNumber.PersonID)=[Me]![ID]));

Me!ID should be the ID from the Person table when that person is selected.
I get the dialog box that asks for the Parameter Value for Me!ID. I've tried
replacing that with Forms!FormName!ID and then it returns the unfiltered list
of contact numbers in the combo box.

Thanks for your help.
 
S

scott

I got it finally. I run a script that updates the combo box at the Form On
Current. I used the Forms!FomrName!ID and it works.
 
S

scott

I spoke too soon.

The solution I came up with gives the correct list of contact info for the
record selected, but when I select a number from the dropdown, it popluates
the dropdown in all the other records listed in the form, clearly not what I
want.

So I'm asking for help on this again. Apologies for the multiple psots.

scott said:
I got it finally. I run a script that updates the combo box at the Form On
Current. I used the Forms!FomrName!ID and it works.

scott said:
I've seen several posts related to this, but I don't seem to be able to get
the answer.

I have a table with people in it and another table with contact info (phone,
email, etc.) The contact info is an ID, personID that relates to the id of
the person in the first table, and contact type. Contact type is an integer
field that relates to teh ID field in a contact type table that has a list of
contact types (home phone, work phone, home email, work email, etc.).

I want to create a continuous form that has the name of the person with a
combo box that lists the contact info for the person whose record is
selected. The query I am using for the combo box that does not work is:
SELECT ContactNumber.id, ContactNumber.Number [I'll add contact type once I
get the form to work]
FROM ContactNumber
WHERE (((ContactNumber.PersonID)=[Me]![ID]));

Me!ID should be the ID from the Person table when that person is selected.
I get the dialog box that asks for the Parameter Value for Me!ID. I've tried
replacing that with Forms!FormName!ID and then it returns the unfiltered list
of contact numbers in the combo box.

Thanks for your help.
 
S

Steve Sanford

Hi Scott,

I'm not sure what you are trying to do, but if one control is showing the
same data for all records of a continous form, it usually means the control
is unbound. Look at the form in design view. there is only one detail
section.

If you add an unbound text box control to the detail section in a form where
the recordset has many records and switcn to continous form view, then enter
something in the text box, it will repeat (be the same) in every record.

HTH
--
Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)


scott said:
I spoke too soon.

The solution I came up with gives the correct list of contact info for the
record selected, but when I select a number from the dropdown, it popluates
the dropdown in all the other records listed in the form, clearly not what I
want.

So I'm asking for help on this again. Apologies for the multiple psots.

scott said:
I got it finally. I run a script that updates the combo box at the Form On
Current. I used the Forms!FomrName!ID and it works.

scott said:
I've seen several posts related to this, but I don't seem to be able to get
the answer.

I have a table with people in it and another table with contact info (phone,
email, etc.) The contact info is an ID, personID that relates to the id of
the person in the first table, and contact type. Contact type is an integer
field that relates to teh ID field in a contact type table that has a list of
contact types (home phone, work phone, home email, work email, etc.).

I want to create a continuous form that has the name of the person with a
combo box that lists the contact info for the person whose record is
selected. The query I am using for the combo box that does not work is:
SELECT ContactNumber.id, ContactNumber.Number [I'll add contact type once I
get the form to work]
FROM ContactNumber
WHERE (((ContactNumber.PersonID)=[Me]![ID]));

Me!ID should be the ID from the Person table when that person is selected.
I get the dialog box that asks for the Parameter Value for Me!ID. I've tried
replacing that with Forms!FormName!ID and then it returns the unfiltered list
of contact numbers in the combo box.

Thanks for your help.
 

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

Similar Threads

Auto Populate a Field 1
combo box setup 6
Populate combo field on form 4
Combo Box Problem 1
Combo Box 3
combo box showing a field or a table list 4
Retain combo box order 1
Moving a value from one form to another 2

Top