A family of Microsoft relational database management systems designed for ease of use.
That suggests that the Text25 control is Null when the code is executed.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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
A family of Microsoft relational database management systems designed for ease of use.
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.
That suggests that the Text25 control is Null when the code is executed.
Ok, are you sure you have a control named Text25?
Try
DoCmd.OpenReport "CODE Q & J CREDITS Subreport", acViewPreview, , "[CustNo]=" & Me.Text25
Try after the & type in Me. and then selecting Text25 from the list that pops up. Also makse sure you aren't using curly quotes instead of the straight quotes. I'm also wondering if the ampersand in your report name is screwing things up. You should never use spaces and special characters in object names. You can also try renaming the report to
srptCode_QandJ_Credits
That would make the code:
DoCmd.OpenReport "srptCode_QandJ_Credits", acViewPreview, , "[CustNo]=" & Me.Text25
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?
show us the exact code