open a second form with DAO

P

Philippe

Hi,

I have two forms:
Institutions
Members (linked with Institution with an ID)

I open both form through DAO in form_load() with
Set rs = db.openRecordset(strSQL)
/* strSQL is like "SELECT * FROM data" */
I need to be able to open each form with all the data.

So each form open correctly.

The problem arise when I want to open Members from
Institutions with a parameter (Institutions.ID).
The only thing I know is DoCmd.openForm("Members") which
gives me all the data, because it activates form_load().
But I only want to open the data which match the ID from
Institutions. Any idea?

I've made a function filterRecord(strCriteria) in Members
which close the recordset and open it with a new one. But
I don't know how to call it from Institutions.

:p hilippe
 
A

Albert D. Kallal

To open the members form from the Inst form, simply go:

docmd.OpenForm "frmMembers",,,"InstitutionsID = " & me.ID
 
P

Philippe

All right, I have found it.

I just needed to change the FilterRecord to public and
call it like that from Institutions.

Form_Members.FilterRecord(strCriteria)

Thanks for anyone who replied.

:p hilippe
 

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