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-23T18:31:14+00:00

    Did you insert a value into the txtCust control before clicking the button.  As I said before, all indications are that the control is Null.

    Was this answer helpful?

    0 comments No comments
  2. ScottGem 68,845 Reputation points Volunteer Moderator
    2016-03-23T18:29:45+00:00

    And you typed in an custom umber before hitting the button?

    This doesn't make sense. this is very standard code. 

    Can you show us the SQL statement that feeds the Credits report?

    If possible could you upload to cloud storage a sample of your file?

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2016-03-23T18:28:31+00:00

    Ok So I tried again and it is opening the report, however the report is showing all customers and not the specific customer I inputted in the search

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2016-03-23T18:24:18+00:00

    Ok so I did exactly what you suggested and when I ran the command I got the same message. I changed the QNCLI to CustNo to see, and same error message saying syntax error (missing operator) "[QNCLI] ="

    Was this answer helpful?

    0 comments No comments
  5. ScottGem 68,845 Reputation points Volunteer Moderator
    2016-03-22T19:41:02+00:00

    Alright lets start this from scratch. Create a new unbound form and put a text box and a button on it. Name the textbox txtCust and button cmdCredits.

    Behind the button put

    DoCmd.OpenReport "Credits",acViewPreview,,"[QNCLI] = " & Me.txtCust

    See if that works.

    Was this answer helpful?

    0 comments No comments