filtering with comboboxes in a subform

A

alcoalex

I’m attempting to filter data in my subform according to data obtained form a
combobox in my main form.

My query filters on this:

[Forms]![frmTasksCompleted]![combo_county]

and works fine in query mode but when I apply this to my form it does not
seem to pick up the value of the combo box. Incidentally other variables
which are sent from my form (like date values taken from text boxes) are
filtering successfully.

Can anyone offer a possible resolution as I’m not sure if the problem lies
with my query or my form?

Many thanks.
 
K

kingston via AccessMonster.com

How are the filters being implemented? There must be some difference between
what works and what doesn't. Is the subform based on a query which in turn
is based on the field in question? Is this field involved in the master-
child relationship between the main and sub forms?
I’m attempting to filter data in my subform according to data obtained form a
combobox in my main form.

My query filters on this:

[Forms]![frmTasksCompleted]![combo_county]

and works fine in query mode but when I apply this to my form it does not
seem to pick up the value of the combo box. Incidentally other variables
which are sent from my form (like date values taken from text boxes) are
filtering successfully.

Can anyone offer a possible resolution as I’m not sure if the problem lies
with my query or my form?

Many thanks.
 
A

alcoalex

The subform is based on a query.

The user selects an option from the combo box of the main form and on
submission of the form there is a request for the subform to be re-queried, I
have my query in the subform requesting the appropriate form field (i.e. the
combobox) as its filter.


kingston via AccessMonster.com said:
How are the filters being implemented? There must be some difference between
what works and what doesn't. Is the subform based on a query which in turn
is based on the field in question? Is this field involved in the master-
child relationship between the main and sub forms?
I’m attempting to filter data in my subform according to data obtained form a
combobox in my main form.

My query filters on this:

[Forms]![frmTasksCompleted]![combo_county]

and works fine in query mode but when I apply this to my form it does not
seem to pick up the value of the combo box. Incidentally other variables
which are sent from my form (like date values taken from text boxes) are
filtering successfully.

Can anyone offer a possible resolution as I’m not sure if the problem lies
with my query or my form?

Many thanks.
 
K

kingston via AccessMonster.com

What do you mean by "query in the subform requesting the appropriate form
field"? IOW, do you mean that the combo box returns the name of the control
that should be used as the criteria or that it returns the value that should
be used as the criteria? Usually, a query has something like [Forms]!
[frmTasksCompleted]![combo_county] as the criteria for one of its output
fields. If this query is the basis for a form, the form must be requeried if
a different selection is made in the combo box:

Me.SubForm.Requery
The subform is based on a query.

The user selects an option from the combo box of the main form and on
submission of the form there is a request for the subform to be re-queried, I
have my query in the subform requesting the appropriate form field (i.e. the
combobox) as its filter.
How are the filters being implemented? There must be some difference between
what works and what doesn't. Is the subform based on a query which in turn
[quoted text clipped - 17 lines]
 

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