Subform, synchronised Combo boxes

poulsotw

Registered User.
Local time
Today, 21:25
Joined
May 6, 2003
Messages
17
Hello

I have a form called "frmSelector" with 2 synchronised combo boxes "cboCategorySelect" and "cboProductSelect". I copied these from Article 98660 from MS Knowledge Base. This links each combo box to a query, the first combo box also has an After Update macro (the only macro) which initiates a requery when the first combo box is updated.
This form works fine until it is used as a subform in the main form "Main Info" where instead of running as before the user is prompted for a parameter value.
Presumably changes are needed somewhere ?
I am using Access97.

any comments very much appreciated,

cheers,
Toby.
 
Usually Access prompts you for a parameter value in a query when something is ambiguous. If the only change you've made to the form was making it a subform, you probably need to change the references that the query is making to the form.

The generic notation for controls on a form being referred to from a query is this:
[Forms]![FormName].[fieldname]

But when the form is then made into a subform, you need to change the syntax to:
[Forms]![FormName].[subFormName].[Form].[fieldname]
 
thanks for your help, I have tried the following :-

IIf(IsNull([Forms]![frmtblForecast].[frmSelector]![cboCategorySelect]),[CategoryID],[Forms]![frmtblForecast].[frmSelector]![cboCategorySelect])

and this seems to work. Unfortuntaley now when I select the category in the next subform record the value in the 2nd combo box of the previous record dissappears. Although the data is still present in the underlying tables.

I will do a search again on MS knowledge base - but if this is something that has another quick fix any help much appreciated,

cheers again,
Toby.
 

Users who are viewing this thread

Back
Top Bottom