Solved

Print the current record

Posted on 1998-08-27
3
326 Views
Last Modified: 2006-11-17
  Dear Expert,
I made a form where you view the records from a table. I also made a button at the form footer using the command button wizard to print that record. But when I run it instead of printing the current record(through a Report) it keeps printing all the records sequentially. How can I make that button to print only the record fields I am viewing?
   
               Thanks again
                  George.
0
Comment
Question by:gsazeides
[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
3 Comments
 
LVL 8

Expert Comment

by:Helicopter
ID: 1960444
check the code behind the button. It sounds like you need a where clause in there (e.g. "Where recordID=" & me.recordID)
0
 
LVL 4

Expert Comment

by:tomook
ID: 1960445
The fourth argument to DoCmd.OpenReport allows you to specify a WHERE condition. The third argument allows specifying a filter. If you have the form selecting only some records, you obviously already know or can find out how the records are filtered or selected. Just put the appropriate

Ex:
DoCmd.OpenReport "MyReport", acViewNormal, , "(Customer=5) AND (Payment>5.00)"

If you need more specifics, please supply the fields in the form, and how you select the fields to view.
0
 

Accepted Solution

by:
sanctified earned 0 total points
ID: 1960446
Your answer (2 possibilities)

Using a function:

This function will put a message box up asking for what specific page you want to print:

Function PrintPage (reportname As String) As Integer
a = InputBox("Select Page to Print")
 DoCmd Echo False
 DoCmd OpenReport reportname, A_DESIGN
 DoCmd Print A_PAGES, a, a

 DoCmd SetWarnings False
 DoCmd Close A_REPORT, reportname
 DoCmd SetWarnings True
 DoCmd Echo True

ttp_exit:
 Exit Function

ttp_error:
 DoCmd Echo True ' restore screen echo
 Resume ttp_exit

End Function

Using a macro:

DoMenuItem

MENUBAR:  DATABASE
MENU NAME:  FILE
COMMAND: PRINT

This command will bring you to a print window allowing you to choose all pages, you current selection or specified pages.

Enjoy!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
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 …

749 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