Printing Subreports

Anonymous
2016-03-21T14:14:02+00:00

Hi, I have created a form in access 2010 called "customer profile" on the form I have 2 reports that I created and dragged  onto the form "Credits" and "Denials"

On my 'customer profile' form I have a search button where when we enter the customer number of a client the information regarding that specific client populates on the (subreports) on the form 'Credits and Denials'.

When we go to print the reports for the specific customer the criteria changes and ALL customers start to print rather than the specific customer we searched for.

How can we fix this, please help

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

42 answers

Sort by: Newest
  1. ScottGem 68,845 Reputation points Volunteer Moderator
    2016-03-21T15:08:44+00:00

    You seem to be mixing up Forms and Reports. Forms are meant to interact with data, Reports are meant to output data and they shouldn't be mixed.

    When you elect to print a report, if you only want to print the report for the record currently displayed on a form, you need to use the WHERE clause of the OpenReport method to filter for

    "CustomerNumber = " & Me.CustomerNumberControl

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2016-03-21T14:39:33+00:00

    Hmmm....

    Shouldn't a Form have a SubForm, and a Report have a SubReport?

    Regardless, you should be able to filter the report so that it displays information relevant to the selected customer only.

    This can be done in a variety of ways, with the most common method probably being the use of the CustomerID from the form being passed as criteria to the query that is being used as the Recordsource for the report.

    Here's an example of a query's SQL string that does just that:

    SELECT tblCustomers.*, tblCustomers.CustID

    FROM tblCustomers

    WHERE (((tblCustomers.CustID)=[Forms]![frmCustomers]![CustID]));

    (This query would also be used as the recordsource for the main report.)

    Was this answer helpful?

    0 comments No comments