change subform recordource from another subform

qwertyjjj

Registered User.
Local time
Today, 10:42
Joined
Aug 8, 2006
Messages
262
Is it possible to change a subforms recordsource from another subform?

For example, I have a 3 forms:
Form1
Form2
Form3

Form2 and Form3 are displayed as subforms on the top level Form1.
There are a load of drop downs in Form2 that I need to change a recordsource in Form3.

Is this possible and if so, how can it be done in VBA?
 
You need to capture the values of your dropdowns in the
first subform and use those values to build your SQL string
to serve as the record source of your second subform.

Go to design view of your second subform and bring up the
datasource in the query grid. In the criteria of the relevant
fields, you need to reference the textboxes of the the first
subform to capture their values. This will turn the query into
a parametized query.

See if the above works for you.
 

Users who are viewing this thread

Back
Top Bottom