Hello,
I am using MS Access 2002-2003. I added a "Print Record" command button to a form in my database. Is there a way (via VBA or anything else) to open a print preview screen when the command button is selected instead of immediately printing the record?
Thank you!
Martin DH
5 8354
Hello,
I am using MS Access 2002-2003. I added a "Print Record" command button to a form in my database. Is there a way (via VBA or anything else) to open a print preview screen when the command button is selected instead of immediately printing the record?
Thank you!
Martin DH
Print Preview was designed primarily as the View Argument to the OpenReport() Method. From my knowledge, it was not intened to be utilized for individual Record printing. The following code will, however, work but probably not with the intended result. It is simply out of context. Try it and see: - DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
-
DoCmd.RunCommand acCmdPrintPreview
Assuming the current code is ... -
DoCmd.OpenReport "Report Name", , , [WhereCondition]
Change it to ... -
DoCmd.OpenReport "Report Name", acViewPreview, , [WhereCondition]
Assuming the current code is ... -
DoCmd.OpenReport "Report Name", , , [WhereCondition]
Change it to ... -
DoCmd.OpenReport "Report Name", acViewPreview, , [WhereCondition]
Hello Mary:
I was under the assumption that the OP was printing a Record from Form View. Is my interpretation wrong?
Hello Mary:
I was under the assumption that the OP was printing a Record from Form View. Is my interpretation wrong?
I wasn't sure from the question so offered the alternative solution. I'm sure we'll find out eventually.
Mary
I wasn't sure from the question so offered the alternative solution. I'm sure we'll find out eventually.
Mary
Yes, I am working in the form view. Below is the code from the print record command as is. The DoCmd.RunCommand acCmdPrintPreview code brings up a print preview of all the records, not just the selected record. I appreciate the help! - Private Sub Print_File_Click()
-
On Error GoTo Err_Print_File_Click
-
-
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
-
DoCmd.PrintOut acSelection
-
-
Exit_Print_File_Click:
-
Exit Sub
-
-
Err_Print_File_Click:
-
MsgBox Err.Description
-
Resume Exit_Print_File_Click
-
-
End Sub
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Darcy Kahle |
last post by:
I am trying to do some advanced printing in python using the win32ui
module, and have run into an issue. I need to print a page landscape.
As I could not determine how to specify the orientation...
|
by: Marina Ferguson |
last post by:
Hi,
I have a document with an iframe. The main doc has a "Print" button. The
idea is that when the user clicks it, the contents of the iframe is printed.
For some reason instead of the iframe...
|
by: TJ Walls |
last post by:
Hello All,
Is it possible to create a <select> element with no selected options? I
have tried setting the selectedIndex attribute to -1, but as far as I can
tell this only works for <select...
|
by: Tony Williams |
last post by:
I have an Access database that we use as a document index system. The
documents can be Word, Excel, pdf's etc I have a command button on a form
that opens the document in whatever program is...
|
by: Stefania Scott |
last post by:
I am trying to print a word document from Access. The code I've
written works well in my computer but does not in the one were it is
needed.
Here the piece of code:
'doc path
strObjectPath =...
|
by: Dreamtime |
last post by:
Hi
I am using Visual Studio 2005 and the bundled Crystal Reports
(previously I used .net 2003 and bundled Crystal Reports for 2 years -
same issues!)
I have a report which is displayed in the...
|
by: Stinky Pete |
last post by:
Hi,
I've been reading, and successfully tested some code referred to in
this group, that allows a user to select a printer before printing a
report. The code has worked well on single page...
|
by: Richard MSL |
last post by:
I have an application that prints documents that it creates. It uses what I
believe is a standard .NET way of doing so, like this:
PrintDocument pd = new PrintDocument();
pd.PrintPage += new...
|
by: deepakfordotnet |
last post by:
Hi,
First of all let me confess that I could not get the solution to the same problem from an earlier post Printing :by Mr.Richard MSL (dated September 24th 2006) working.
(Replied by Mr.Walter...
|
by: Rina0 |
last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM)
The start time is equivalent to 19:00 (7PM) in Central...
|
by: erikbower65 |
last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps:
1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal.
2. Connect to...
|
by: linyimin |
last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
|
by: erikbower65 |
last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA:
1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
|
by: DJRhino1175 |
last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this -
If...
|
by: lllomh |
last post by:
Define the method first
this.state = {
buttonBackgroundColor: 'green',
isBlinking: false, // A new status is added to identify whether the button is blinking or not
}
autoStart=()=>{
|
by: lllomh |
last post by:
How does React native implement an English player?
|
by: DJRhino |
last post by:
Was curious if anyone else was having this same issue or not....
I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
| |