Can I use a the same form for more than one query?

  • Thread starter Thread starter Marion
  • Start date Start date
M

Marion

I have a form layout which will be the same for many
queries. Can I use the same form and "attach" it to
different queries or do I have to create a new form for
each query?
Many thanks
Marion
 
You can utilise the same form for multiple queries by
changing its RecordSource property. You have to bear in
mind that you are restricted to having only one copy of the
form loaded at any one time.

Hope That Helps
Gerald Stanley MCSD
 
Hi Gerald,

Gerald said:
You can utilise the same form for multiple queries by
changing its RecordSource property.

This is correct -
You have to bear in
mind that you are restricted to having only one copy of the
form loaded at any one time.

Actually you can have more than one copy of the form loaded if you
instantiate the forms. Then by referencing the appropriate instance of the
form you can alter it's recordsource without affecting the other instances.
There is an example of this on my website
http://www.daiglenet.com/MSAccess.htm.
 
Gerald said:
You have to bear in
mind that you are restricted to having only one copy of the
form loaded at any one time.

If you insist on having multiple instances of that form, I have done
that. Maybe my site provides enough information, see under Code
Modules:Classes: IFObject and IFObjects
 
I have a form layout which will be the same for many
queries. Can I use the same form and "attach" it to
different queries or do I have to create a new form for
each query?
Many thanks
Marion

How do these queries differ? Apologies if you're doing something
advanced and this is obvious but... you may be using queries which
differ only in their criteria. A Parameter query using a criterion
such as

=[Forms]![frmCrit]![txtCriterion]

rather than

="Management"

would give you the flexibility to have one single query with variable
criteria.
 
Back
Top