Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Only print current form/record

Status
Not open for further replies.

cheyenne2002

Instructor
Jul 26, 2005
229
US
I'm new to Access and am trying to use the tool button that prints only the current record on a form that I am viewing.

Problem is that it is printing ALL the forms. Can someone tell me what I am doing wrong?

Thank you
Sharon
 
This is normal behavior. If you want to print only the current record, select File->Print->Selected Record. Or place a command button on your form, and use the wizard for Record Operations->Print Record.

Ken S.
 
If you want only the current record to print to a report, when you do call the OpenReport command, you would put a select criteria at the end; ie a unique key for the record which you are currently displaying

The code would look something like this:

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "rptEquipmentMaster"
stLinkCriteria = "[ID] = " & Me![ID]
DoCmd.OpenReport stDocName, acNormal, , stLinkCriteria



In the stLinkCriteria field [ID] is the name of the field in the file, while Me![ID] is the field on the form

Hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top