referencing multiple forms?

  • Thread starter Thread starter Jeff Klein
  • Start date Start date
J

Jeff Klein

I have a query that references filds on a form eg.
[forms]![frm_calendar]![cbo_Name]. I want to create another form that will
also use the same query. Is there a way to reference multiple forms instead
of copying the query and changing the reference?
 
not really.
[forms]![frm_calendar]![cbo_Name] references a specific
contol in a specific form. so the query will always be
looking for the same form. even if you do it with code,
you would still end up writing 2 querys because of the
form reference.
-----Original Message-----
I have a query that references filds on a form eg.
[forms]![frm_calendar]![cbo_Name]. I want to create another form that will
also use the same query. Is there a way to reference multiple forms instead
of copying the query and changing the reference?


.
 
Is there a way I can replace the form reference with a public string?

not really.
[forms]![frm_calendar]![cbo_Name] references a specific
contol in a specific form. so the query will always be
looking for the same form. even if you do it with code,
you would still end up writing 2 querys because of the
form reference.
-----Original Message-----
I have a query that references filds on a form eg.
[forms]![frm_calendar]![cbo_Name]. I want to create another form that will
also use the same query. Is there a way to reference multiple forms instead
of copying the query and changing the reference?


.
 
My suggestion would be, do not use this kind of specific filter in your
queries.
Instead filter it on the final end, use the option Criteria of the OpenQuery
function wherever you call it from:
"[YourFiled] = " & [forms]![frm_calendar]![cbo_Name]

If you have a form or a report using the query, instead of bounding it
directly to your query, you can use :
Select * from [YourTable] where [YourFiled] =
[forms]![frm_calendar]![cbo_Name].

This what, you can use your query from anyplace in your database

Let me know if it worked.

Take Care
Mauricio Silva
Jeff Klein said:
Is there a way I can replace the form reference with a public string?

not really.
[forms]![frm_calendar]![cbo_Name] references a specific
contol in a specific form. so the query will always be
looking for the same form. even if you do it with code,
you would still end up writing 2 querys because of the
form reference.
-----Original Message-----
I have a query that references filds on a form eg.
[forms]![frm_calendar]![cbo_Name]. I want to create another form that will
also use the same query. Is there a way to reference multiple forms instead
of copying the query and changing the reference?


.
 
Back
Top