• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 159
  • Last Modified:

Print current record displayed in the form

I have a command button in the footer of a form.  The form is Display View = Single Page.

Even though the form has several records that can be navigated to, I want to print JUST the record being displayed.  

What would the onclick code of the command button be to accomplish this?
0
SteveL13
Asked:
SteveL13
  • 3
1 Solution
 
Rey Obrero (Capricorn1)Commented:
create a report with recordsource based on the recordsource of your form then use this codes

docmd.openreport "NameOfReport", acviewNormal,, "[IdfieldName]=" & me.txtIdfield


change [IdfieldName] with actula name of the field
change txtIdfield with actual name of the control
0
 
SteveL13Author Commented:
I actually just want to print the form with the current record data included.  I realize that a report would be better looking.
0
 
Rey Obrero (Capricorn1)Commented:
access report is not really for printing, you may not like the result.
0
 
Rey Obrero (Capricorn1)Commented:
oops, that should be

access FORM  is not really for printing, you may not like the result.
0
 
Phillip BurtonCommented:
Try:

    If Me.Dirty Then
       Me.Dirty = False
    end If
    DoCmd.RunCommand acCmdSelectRecord
    DoCmd.PrintOut acSelection
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now