Filter based on another forms recordset

stephen81

Registered User.
Local time
Today, 00:05
Joined
Nov 27, 2002
Messages
198
I've got a form based on a query. Is there a way I can filter the records showing on the form, based on the records in another form's recordset.
I've managed to get the second form to show the same records as the first using
me.recordset = forms!otherform.recordset

but I actually want some different fields in my second form so want to base it on a different query.

Can I do something along the lines of...
Form1 based on Query1 with fields CustID, Field1
Form2 based on Query2 with fields CustID, Field2 but filtered where CustID in Form1.Recordset?
I've probably not explained that very well so please ask if you need more info. :)
 
Use CustID form 1 as crirteria in form 2:

IN CRITERIA for Cust id
Forms![Form1]![txtCustID]

SQL:
SELECT Table1.[CustID]
FROM Table1
WHERE (((Table1.[CustID])=[Forms]![Form1]![txtCustID]));
 
Thanks for the reply Jerry, I forgot to mention that my forms are continuous forms so I don't think this will work.
 
Then you will need to pass the filter value in as a variable. Take a look at the OpenArgs function.
 
I can pass a value with openargs without a problem, but I'm struggling to know what I need to value I need to pass to the second form for my filter.
Something along the lines of
Code:
where me.custid in (select custid from firstform.recordset)
maybe?
 

Users who are viewing this thread

Back
Top Bottom