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-22T12:38:46+00:00

    This is the code and error message:

    Private Sub Command21_Click()

    DoCmd.OpenReport "CODE Q & J CREDITS Subreport", acViewPreview, , "[CustNo]=" & Text25

    End Sub

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2016-03-22T01:57:14+00:00

    Hmmmm.

    Try creating a new query, without selecting a table.

    Switch to SQL view.

    Copy and paste Scott's SQL string:

    SELECT CustNo, Custname FROM tblCustomers ORDER BY Custname;

    Switch to Design view. 

    Switch to Datasheet view.

    Does Access complain?

    Does the query return any records?

    Was this answer helpful?

    0 comments No comments
  3. ScottGem 68,845 Reputation points Volunteer Moderator
    2016-03-22T01:54:51+00:00

    show us the exact code

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2016-03-22T01:34:18+00:00

    Thank you, it is still giving me the same error?

    Was this answer helpful?

    0 comments No comments
  5. ScottGem 68,845 Reputation points Volunteer Moderator
    2016-03-21T19:58:30+00:00

    Yes the = goes within the quotes.

    Was this answer helpful?

    0 comments No comments