Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

one query on different forms

Status
Not open for further replies.

vb4me

Programmer
Nov 27, 2001
48
0
0
US
I have a query that gets data from a form. This works fine but I also have 2 other forms that are nearly identical but I do not want to write a query for each form.

So I have query 1 which has criteria [forms][frmForm1]![id]

I also have form 2 and form 3. How can I use just one query to reference the current form that is open?

It will always be id being the field used on the forms.

Thanks
 
Can you set the record source for all three forms to the same query and then set the filter property of the form to filter the query to the desired set of results?
 
the forms already have the same source.

The query I have runs when I click a button and references a field on the form - each form is different so I need it to recognise what form it is on and use that form name.
 
Rather than open a query. Open a form in datasheet view based on that query. It will look like a query, but have most of the functionality of a form. By using a form, you can pass in parameters like a filter.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top