Many forms, one subform?

christakis

Registered User.
Local time
Today, 22:56
Joined
Oct 23, 2009
Messages
72
Hi guys,

I have 22 forms and 22 queries. Each form has a subform which is based on the form's corresponding query. Instead of having 22 subforms can I have the same subform in all forms and populate it with the appropriate query? If yes, when would I populate it and how?

Cheers,
Christakis
 
This is tricky as the subform is actually loaded into the main form before the main form opens. What is different about the queries that means you have to have 22 of them. If the contents of the subform is the same then I can't understand the need. Is it some sort of filtering yur are doing?

David
 
you can change the query that fills the subform, by changing the "recordsource" property of the subform

you can change the form that is displayed in the subform, by changing the "sourceobject" property, of the subform control in the mainform

do either of those help?
 
Thank you both for your replies. I am still processing the info you gave me but here are answers to your questions.

Each query is used for filtering. It returns all the fields of the correspoinding table + it filters out the results based on the selection of dropdown menus. here's part of the additional SQL code I use to do this.
Code:
[SIZE=2]AND (([Type] = [Forms]![frmSrchC9]![cboType] Or [Forms]![frmSrchC9]![cboType] Is Null)=True)[/SIZE]

The subform in each form is essentially used to display the results of the query.

Does the subform have a form part and a query part? Note that the 22 forms have both common and unique fields.
 
So what actually makes one subform different from the other 21?
Is it purely the contents of the underlying query?
What type of layout is the subform? Datasheet?
What are you using for Master/Child linked fields?

David
 
1.) So what actually makes one subform different from the other 21?
2.) Is it purely the contents of the underlying query?
3.) What type of layout is the subform? Datasheet?
4.) What are you using for Master/Child linked fields?

David

Right,
1.) In design view, the fields available in each sform are all non hidden fields of the query it is based on. Each query returns different fields as it is based on different tables.

2.) Yes

3.) Yes, Datasheet. The form is simply a filter down, search form with a datasheet subform. The subform displays all data in the table and filters them down based on selections in the form. When the user finds what he likes he double clicks the row of the datasheet subform and triggers a function, but thats a different thing all together.

4.) No idea what you are talking about sorry.

Christakis
 

Users who are viewing this thread

Back
Top Bottom