Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

limit combobox in subform to variable list

Status
Not open for further replies.
May 5, 2000
168
US
My Main form has two key fields. [ComplaintNo] and [IncidentNo].

The Subform is related to main form by [IncidentNo]. It is based on a table "Colors". "Colors" table has an IncidentNo field and a color field. Each incident has a different set of colors that belong to it.

The subform contains a combo box with a list of colors. I would like the combo box to contain only the colors that relate to the incident number on the record on the main form. Each record on the main form can have a different set of colors depending on what the Incident No is.


I can't get the combo box to filter the colors so only the ones related to the incident are displayed. It only shows all colors in the color table.

I tried typing [forms]![frmMain]![IncidentID] in the criteria, this doesn't work. but If I type an incident number like "2222" in the criteria on the underlying combobox query, the list will filter on that incident.


Any solutions?



 
Hi,

If i am understanding you correctly, what you need is for the subform combobox 'Row source' to contain a query that lists the colors according to the 'IncidentID' record on the main form, and then in the 'On Enter' event in the combo box have the line '[ComboBoxName].REQUERY'. What will happen is when you enter the ComboBox it will requery it and list the colors that relate to the IncidentID on the main form.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top