Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Print the current record

Posted on 1998-08-27
3
Medium Priority
?
342 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

618 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