Help filtering records in a subform

PaulSpell

Registered User.
Local time
Today, 14:59
Joined
Apr 19, 2002
Messages
201
I need some help filtering records in a subform.

The subform is based on a table.

The parent form is unbound and has a combo list from which the user can select a number. The idea is that when the number is selected from the combo, the subform automatically re-filters to show only the records with a matching number field.

I have used the after_update event of the combo to change the recordsource of the subform and then requery it, but it errors saying that it cannot find the form.

I am referencing the subform using:

[Forms]![Formname].recordsource="some sql.........;"

but this doesn't seem to work.

Is there another way of referencing subforms in VBA?
 
Try

Me![your subform].Form.recordsource="some sql.........;"
Me.Refresh

hth

shay :cool:
 
Top man! this is spot on thanks.

Do you know why it doesn't work the other way?
 

Users who are viewing this thread

Back
Top Bottom