Print current record displayed in the form

Posted on 2015-01-26
Medium Priority
Last Modified: 2015-01-26
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?
Question by:SteveL13
  • 3
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 40571320
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

Author Comment

ID: 40571334
I actually just want to print the form with the current record data included.  I realize that a report would be better looking.
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 40571342
access report is not really for printing, you may not like the result.
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 40571344
oops, that should be

access FORM  is not really for printing, you may not like the result.
LVL 24

Accepted Solution

Phillip Burton earned 2000 total points
ID: 40571410

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

Featured Post

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

623 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