Can I filter a subform combo from a textbox value on form

J

Jim Brooks

Is it possible to filter a subform combo from a textbox value on the main
form. I have looked through the Access forum but have not found any help. If
this can be done can the answer be as simple as poss as I am just getting
into Access 2007.
Many thanks in advance
Jim Brooks
 
J

Jim Brooks

Thanks Ken done the trick
Jim Brooks

KenSheridan via AccessMonster.com said:
Set the RowSource of the combo box to reference the text box on the parent
form, e.g.

SELECT MyField FROM MyTable WHERE MyOtherField = Parent!MyTextBox ORDER BY
MyField;

And requery the combo box in the parent form's Current event procedure and in
the text box's AfterUpdate event procedure with:

Me.MySubformControl.Form.MyComboBox.Requery

Note that MySubformControl should be the name of the subform control in the
parent form which houses the subform, not the name of its underlying form
object, unless both have the same name of course.

Ken Sheridan
Stafford, England



--
Message posted via AccessMonster.com


.
 

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