D
Damien McBain
I have a form with some unbound textboxes and a subform on it. The subform's
recordsource is a query which is a joining of a number of tables. The main
form has no recordsource. There are no master or child field links between
the main and subforms.
How can I filter the subform based on the contents of the unbound textboxes
on the main form? I want the subform to return zero (or all, doesn't matter)
records when the form opens, then display records on the subform (from the
query) based on what the user enters into the textboxes. Each textbox
represents a field in the subform. I don't mind if the user has to click a
button to exec some code after the relevant boxes are populated. I also want
a blank text box to return ALL related records (rather than none) and would
like the user to be able to use wildcard characters. Am I asking too much?
I have tried creating a new select query which includes the fields I want to
filter by, then creating a command button on the main form and using the new
query as a filter. I don't know how to use the ApplyFilter method to the
subform using a control on the main form or even whether this is the correct
way to approach the problem.
Any assistance appreciated.
cheers,
Damo
recordsource is a query which is a joining of a number of tables. The main
form has no recordsource. There are no master or child field links between
the main and subforms.
How can I filter the subform based on the contents of the unbound textboxes
on the main form? I want the subform to return zero (or all, doesn't matter)
records when the form opens, then display records on the subform (from the
query) based on what the user enters into the textboxes. Each textbox
represents a field in the subform. I don't mind if the user has to click a
button to exec some code after the relevant boxes are populated. I also want
a blank text box to return ALL related records (rather than none) and would
like the user to be able to use wildcard characters. Am I asking too much?
I have tried creating a new select query which includes the fields I want to
filter by, then creating a command button on the main form and using the new
query as a filter. I don't know how to use the ApplyFilter method to the
subform using a control on the main form or even whether this is the correct
way to approach the problem.
Any assistance appreciated.
cheers,
Damo