Share via

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: Most helpful
  1. Anonymous
    2016-03-21T17:18:35+00:00

    The idea is to have a database with the reports already there on the form for users to print. The information they need is filtered by simply inputting the customer number

    and when the reports populate with the information they can click a button and have the subreports print. However i cant 

    get them to print filtered with just the selected customer, when we print all customers print off.

    Was this answer helpful?

    0 comments No comments
  2. ScottGem 68,830 Reputation points Volunteer Moderator
    2016-03-21T16:38:50+00:00

    Why are you putting Reports on a form instead of subforms? 

    How are you triggering the report printing?

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2016-03-21T16:07:51+00:00

    Maybe I am not explaining it properly.

    I created a form "customer profile' then I created two subreports. In Design view I dragged my subreports right onto my form so when I enter in a customer number into the search button on my form it populates both the subreports with the information that I need.

    I have no clue about codes etc. so if you can help me with that so I am able to print the information in my subreports without it printing all the customers in my dbase that would be great!

    Was this answer helpful?

    0 comments No comments
  4. ScottGem 68,830 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
  5. 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