Solved

Print current record displayed in the form

Posted on 2015-01-26
5
154 Views
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?
0
Comment
Question by:SteveL13
  • 3
5 Comments
 
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
0
 

Author Comment

by:SteveL13
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.
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 40571342
access report is not really for printing, you may not like the result.
0
 
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.
0
 
LVL 24

Accepted Solution

by:
Phillip Burton earned 500 total points
ID: 40571410
Try:

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

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

733 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