Subform ComboBox Queries from Main Form

Trodelphin

Registered User.
Local time
Today, 13:28
Joined
Nov 13, 2010
Messages
42
have a problem where the query works but the results dont refresh later
ie queries all the items in (storeA) on Main Form for the combo box in Subform but when i move to next form/s with (StoreB) the combo box results still equals results of (StoreA)
if open fresh and go to a form with (StoreB) it will show its results on all Forms from then on
 
Sound's like a cascading combo box set.

With any cascading combo box set you need to re-query the cascaded combo in the form's On Current event as well as the master combo's On Change event
 
cheers for reply :)

hmmm im using;
SELECT Description.[Price@], Main.JobNo, Description.JobNo
FROM Main INNER JOIN Description ON Main.FormNo = Description.FormNo
WHERE (((Description.JobNo)=[Forms]![MainForm]![JobNo]));

but setting it to the on change event of my combo box in the subform seems to make no difference still working fine on first query but still no refresh change
setting it to the Subforms On Current just generates an error
 
I think you have misunderstood, what you need is;
Code:
Me.CascadedComboName.Requery
In the On Current and On Change events, this will keep the cascaded combo synchronised with the mater combo.
 
i kept getting errors and interference with
Me.CascadedComboName.Requery or

cmbSecondComboBox.requery

or

docmd.requery "cmbSecondComboBox"

mostly with unrecognized me. errors
and anything on the "On Change" line immediatly threw up an error
but i got it working with macro on After Update requery although this is not 100% as obviously dosent kick in till the 2nd line
 
strike that i got it working with a single macro on the subform On Current Requery the field macro

Now to sort out my Report problems
been 18 hrs straight on this Db better get some shuteye :P
 

Users who are viewing this thread

Back
Top Bottom