Jul 31 2007, 08:06 AM
What im trying to do is to create a report from a form. I have made a template for the report i would like to use.
What i have is a form which contains details of a customer. What i would like to do is when on a certain customer to be able to view their details that are shown on the form to appear on a report which can be printed off.
What is the best way to be able to do this?
Jul 31 2007, 08:25 AM
Create a query that returns only the data displayed on the form (i.e. Put =Forms!frmName!ControlName changing frmFormName to match your actual form's name and control name to the control on your form that contains the record primary key). Bind your report to new query.
Jul 31 2007, 08:37 AM
Once i have created the query, where do i place the code, =Forms!frmName!ControlName?
Jul 31 2007, 08:40 AM
In the criteria line for the record's primary key.
Jul 31 2007, 08:44 AM
That seems to be working but it keeps on asking for a parameter value. How do i stop this?
Jul 31 2007, 09:28 AM
The form needs to be open for the query to work properly (i.e. return on the record displayed). Is the form open?
Jul 31 2007, 09:31 AM
Yes the form is open. This enter parameter value occurs when i use the button from the form to open the report and also when i try and open the report on its own.
Jul 31 2007, 10:09 AM
Assuming you have named the form and control in the criteria correctly, you should not be getting the message. Let me see if I can whip up an example for you.
Jul 31 2007, 10:22 AM
Ok, here is a simplistic example of what I'm suggesting. Rip it apart and see how it works. If you have any questions, UA will be here.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here