Filter Records on one Subform on Selection in Another Subform

T

tina

you should be able to filter one subform from another
subform. here's an example of one way i can think of:

we'll call the forms
Form1 (main form)
Form1A (first subform)
Form1B (second subform)

in Form1A's OnCurrent event, enter code
**air code**
Dim frmParent as Form
Set frmParent = Forms!Form1

frmParent!Form1B.Filter = "Form1BFieldName = " & frmParent!
Form1A!Form1AControlName
(that works for a numeric value; if the value is text,
then use the next line instead)
frmParent!Form1B.Filter = "Form1BFieldName = '" &
frmParent!Form1A!Form1AControlName & "'"
frmParent!Form1B.FilterOn = True
**air code**

hth
 

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