subforms from an unbound form

W

W

Hi,

I have an unbound form with two subforms : SbFrm1 and SbFrm2.
These two subforms are bound forms, so have their own recordset, e.g. :

“select * from tblTable1†- recordset for SbFrm1

and

“select * from tblTable2†- recordset for SbFrm2

On my main form I have a combobox CboBox; CboBox.column(0) contains the
value I want to use to filter the recordset of both subforms, strKey.

I do not think I can set a parent-child relation between the main form and
the subforms.

But then I do not know neither how to limit the records of these forms to
only show these records where strKey is identical to the CboBox.column(0)
value.

Any help will be appreciated.

W
 
J

Jeanette Cunningham

Hi,
you could use the value from cboBox to filter both subforms

If you need some sample code to set filters from a combo box
have a look at (or download) the sample search form on
www.allenbrowne.com

Jeanette Cunningham
 
B

Baz

Assuming that column 0 is the Bound Column for the combo box, simply set the
Link Master Fields property to the name of the combo control i.e. CboBox.

However, I have observed some horrendous performance problems in Access 2007
when linking a subform to a control in this way: sometimes it takes forever
to requery the subform after the value of the control is changed.
 
K

Klatuu

One way would be to use queries as the recordsource of the two subforms that
are both filtered on the value in the combo box. Then in the After Update
event of the combo box, requery both subforms.
 

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