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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using a form to populate a Query from a Report and a Form.

Status
Not open for further replies.

TimGoose

MIS
Aug 9, 2002
7
GB
Hi,

I'm running Access 2010, and what I'm trying to do is as follows.

I have a Report ("rptConsultants Sales Report") which is populated from a SQL Query ("qryReport6"). The query accesses some of its selection criteria from a form ("frmReport6") which allows the user to enter three fields; "User", "From Date", "To Date". This works absolutely fine - I run the report, the form pops-up, I enter the data and press <OK> and I'm presented with the report with the correct selection criteria applied to the data. So far, so good.

I have a second requirement which I have implemented as a Form ("frmFolderBalanceEnquiry") because I need to be able to click on the records returned and open a second form to show the details of the record selected. The primary form uses a sub-set of the data and the same selection criteria as the "rptConsultants Sales Report" so I have used the same SQL query ("qryReport6") and hence the same Form to input the selection criteria into the query. When I run the "frmFolderBalanceEnquiry" however the selection criteria form doesn't appear. Instead I get the query pop-up asking for the data for the fields,

ie "Enter Parameter Value
Forms!frmReport6!cmbxxx"

I'm guessing that there is a problem with trying to display a second form when one is already open, but can anyone give me a clear understanding of what is happening and how (if at all) I can get it to work?

Many thanks, Tim
 
Both forms should be open with data filled in when you run the report. Form what I am reading it sounds like you are expecting a form to open because a query is calling it?
 
That's correct. When I open the "rptConsultant Sales Report" access runs the "qryReport6" SQL query, and this then displays the "frmReport6" for me to enter the selection criteria into. This all works fine.

The form "frmFolderBalanceEnquiry" runs the same query ("qryReport6") which refers to the same form ("frmReport6") but in this case the second form ("frmReport6") doesn't display and I get the pop-ups asking me for the required data.
 
Access does not automatically open the form for you... You must be clicking a button that has code to open the form and something on the form runs the report.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top