[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How print report using key field on report as criteria for the report

Posted on 2013-05-21
2
Medium Priority
?
378 Views
Last Modified: 2013-05-22
On a form I have several fields and the form has tblMatlsTrans as its record source.  One of the fields is the key field named ID.  Also on the form is a command button that the user will use to print a report of that record but it has to use ID as it's criteria.  What is the onclick code for the command button?
0
Comment
Question by:SteveL13
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 48

Accepted Solution

by:
Dale Fye earned 2000 total points
ID: 39185571
something along the lines of:

Docmd.Openreport "reportName", acViewPreview, , "[ID] = " & me.[ID]
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 39188201
<No Points wanted>

On the chance that the ID is textual, use something like this:

Docmd.Openreport "ReportName", acViewPreview, , "[ID] = " & "'" & me.[ID] & "'"

JeffCoachman
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question