Filter a Form based on a field in another form (1 Viewer)

Pauline123

Registered User.
Local time
Today, 20:34
Joined
Apr 1, 2013
Messages
69
Hi, hope someone can help - I have a form (Suppliers) with a button that opens another form (Product List).

At the moment the form (Product List) is set as a pop-up form and when opened lists all products.

I want to filter the pop-up form to only display products for the current supplier displayed in the Supplier Form.

I have tried the following below without success - I have varied this but the filter does not apply - can anyone give me any pointers please.

Private Sub Form_Load()
DoCmd.OpenForm "Product List", acNormal, , "SupplierID = " & SupplierID
End Sub

Many thanks - Pauline
 

JHB

Have been here a while
Local time
Today, 21:34
Joined
Jun 17, 2012
Messages
7,732
You've to put the code behind the button's click event!
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 20:34
Joined
Jul 9, 2003
Messages
16,282
Does your product list have a field SupplierID?

What is the record source of form suppliers?

What is the record source of form product list?
 

Pauline123

Registered User.
Local time
Today, 20:34
Joined
Apr 1, 2013
Messages
69
Hi thank you both for replying - this is what I get for not being totally awake and working on Access - put the code behind the buttons click event and it now works beautifully thank you both for your help.
Pauline
 

Users who are viewing this thread

Top Bottom