Refreshing combobox criteria

R

Ray

I am tracking Packaging line audits

I have 2 forms; MainForm and SubForm

On the Main Form I enter the type of Packaging line, (“high speed†or
“manualâ€) using a combobox

On the SubForm I use a combobox to enter failures for each record in the
Main Form. The failures are different for each line type. I used
[Forms]![MainForm]![LineType] in the criteria section of the query for the
Failures combobox so that only the failures for the line type chosen in the
MainForm are displayed. This works fine.

The problem is that when I navigate thru the MainForm to look at past
entries, only the failures selected for the “high speed†lines are displayed
in the SubForm combo. If I look at a record for a “manual†line, nothing is
displayed in the SubForm combobox.

How do I refresh the combobox criteria on the SubForm as I move thru the
each of the past records on the MainForm??
 
T

Tore G.

You will normally have to do a requery for your combobox.

To refresh your combobox do one of the following:
Me.Subformname.form.Comoboxname.requery if done from the main form
or
Me.comboboxname.requery if done from the subform (same form as the
combobox).

You can call these from your forms on current event. This event fires when
you go from one record to the next.

Regards

Tore




This wil give the combobox updated records to show in the dropdown list. You
must assure that the criteria for the dropdown list in some way depend on
the contents of your main form.
 

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