How to search for a frmMain by searching idSub on frmSubForm ??

M

Mel

I'm trying to reduce the number of queries and forms in my data
base...
Maybe there is a way to do this... maybe not.

Setup:
- Parent = tblMain with idMain and frmMain
- Child = tblSub with idSub and frmSubForm
- frmSubForm is a Sub Form on frmMain

Question:
- While looking at a random frmMain...
- Can we search the idSub field on frmSubForm for a particular idSub
- Related to another tblMain record (not the current tblMain record)
- And have frmMain change to show the record that is linked to the
idSub Searched for?
- And frmSubForm change to display the particular idSub searched for?

Previously:
The way I have done this in the past is to create a query made up of
both tblMain AND tblSub... then make a form on that frmMain+Sub...
then search that...

Resason:
It would be one less query and one less form to maintain if I could...
.... search the frmSubForm for any idSub and have frmMain change to the
related frmMain and frmSubForm.

Example:
You have order number and want to find the account record (frmMain)
displaying the proper order in frmSubForm

thanks for any help.

Mel
 
R

Rick Brandt

Mel said:
I'm trying to reduce the number of queries and forms in my data
base...
Maybe there is a way to do this... maybe not.

Setup:
- Parent = tblMain with idMain and frmMain
- Child = tblSub with idSub and frmSubForm
- frmSubForm is a Sub Form on frmMain

Question:
- While looking at a random frmMain...
- Can we search the idSub field on frmSubForm for a particular idSub
- Related to another tblMain record (not the current tblMain record)
- And have frmMain change to show the record that is linked to the
idSub Searched for?
- And frmSubForm change to display the particular idSub searched for?

Previously:
The way I have done this in the past is to create a query made up of
both tblMain AND tblSub... then make a form on that frmMain+Sub...
then search that...

Resason:
It would be one less query and one less form to maintain if I could...
... search the frmSubForm for any idSub and have frmMain change to the
related frmMain and frmSubForm.

Example:
You have order number and want to find the account record (frmMain)
displaying the proper order in frmSubForm

thanks for any help.

What is the foreign key that relates the child table to the parent table?
 

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