Modules & VBA :: Determine Which Printer Was Selected From The Print Dialog
Feb 10, 2015
This for an app being used in Access 2003. I'm trying to (sort of) automate naming a PDF report. After the user selects a printer from the print dialog, if the printer name is like "*PDF*" then I want to put the PDF file name in the clipboard so it can be quickly pasted in the file name of the PDF printer's save dialog.
Something like this:
Code:
Dim strSelectedPrinter as string
DoCmd.OpenReport "rpt1", acViewPreview
DoCmd.RunCommand acCmdPrint
[Code]....
but that returns the name of the default printer, not the selected printer.
View Replies
ADVERTISEMENT
Nov 15, 2006
Hi,
I used the code below to hide all the toolbars and then created my custom ReportToolbar so the user can print the report. All works OK; however, the PRINT button on my custom toolbar sends the report imidiately to the printer. How can I create a button that I could add to my custom toolbox which would open the dialog box that allows to choose the printer, number of pages to print, etc.. (same action as I can get by going to File->Print)?
PS> Also, is there any way to remove the drop down arrow from my custom toolbox? I disabled Customize Toolbox but the pulldown arrow still appears. I found making an MDE would take care of this, but was wondering if there was another solution.
Code used to hide toolbars:For i = 1 To CommandBars.Count
CommandBars(i).Enabled = False
Next i
View 3 Replies
View Related
May 19, 2014
I want to put a print button on my data entry form that prints the current record in a report that is laid out all nice and pretty. I found this code that works, but it goes straight to the printer - it does not bring up the printer dialog so you can select a printer.
Code:
Private Sub RecordPrint_Click()
Dim strWhere As String
If Me.Dirty Then
Me.Dirty = False
End If
[Code] ....
How do I get it to bring up the printer dialog?
View 7 Replies
View Related
Jul 25, 2013
I have an application (2007 accde) that has been working for some time, this line specifically:
Application.FollowHyperlink Me.txtAttachment
On one users PC (XP Pro SP3), this has worked from day one. His PC got infected to the point that I had to wipe/rebuild it, and suddenly this code throws a warning and then an error. The warning I could live with (it's the MS Office "some files can contain viruses..." warning). However, after clicking on OK for the warning, I get an error that says "Can't print form image to this type of printer". Doesn't make sense, as this user has the same default printer he had before, plus I tried with a different default printer.
if I navigate to the file location on his PC I can open any of the files, so I don't think it's a permissions issue. The code works fine on my PC and a VM with a different OS, and it still works fine for other users.
View 6 Replies
View Related
Jun 12, 2014
I am having trouble with a If statement. I am trying to save a record into a table when an item is Selected (highlighted blue) in a list box. Keep in mind that my listbox is set to multiple selections. I have the following code but sometimes it works and sometimes it doest.
The reason why I am trying to get this to work is because when a item is selected I will add it to the table and when an item is deselected I will delete it from a table. See my code and pictures I have attached :
Private Sub list_audits_Click()
Dim strsql As String
Dim list As String
Dim id As String
id = Me.User_ID.Value
[Code] ....
View 2 Replies
View Related
Jul 28, 2015
Users of the db I am working on print using a regular network printer 95% of the time. 5% of the time however, they need to change that printer to another one, or to a PDF printing program. All of the printers they need are installed in their Printers folder.I can think of two possible courses of action here:
1. load the printer dialog box (preferred)
2. provide them with a custom interface to select a temporary printer
I don't want them to have to load the printers folder and switch the printer temporarily.how to load the printer dialog.
View 4 Replies
View Related
Jul 16, 2007
How can I print a report and at the same time programatically set the printer name and 'Print to File' option and set the path of this option?
View 1 Replies
View Related
Jul 16, 2013
I have a database with a mail label printer and another printer attached to the computer. I would like the user to hit the command button for each of the printers and have the selected data printed without having to select which printer to use each time.
Note: Printer "set up" doesn't work, even when form is in design view, because after print is done, back to dialogue box when trying to print the next time.
View 2 Replies
View Related
May 25, 2013
I have an unbound form with an associated report. When the user hits the 'print' button on the form/screen, the report is launched in the background. In the On Load event of the report I populate the report fields from the forms field as so:
Code:
Me.txtAddrMainLine2 = "NAME " & UCase([Forms]![frm_OrderRx].[txtPatientName])
This works like a charm as long as I call the report in Print Preview mode (i.e. with acViewPreview). But if I send the report directly to the printer, none of the fields print.
I've read about using other report events to populate the fields (e.g., On Format and On Print) and also something about using TempVars to pass the data. But I haven't read anything that's clear and definitive about the full answer.
View 3 Replies
View Related
Sep 14, 2005
Hello,
Is it possible to get Access to open the print dialogue box instead of printing direct to the default printer when using the print command?
Thanks
View 1 Replies
View Related
Sep 14, 2005
Hello,
Is it possible to get Access to open the print dialogue box instead of printing direct to the default printer when using the print command from a button?
Thanks
View 3 Replies
View Related
Oct 6, 2006
Hello.
As my title states, that is my problem! I'm building search criteria from a form and have multiple list boxes... I want to be able to determine whether or not a list box has items selected or not. I have tried as many things as i knew how to with no luck...
Also, i searched the forum but could not find what i was looking for -_-
Thanks for any and all aide!
View 2 Replies
View Related
Feb 10, 2014
I have a project which produces a report of names, addresses, etc. I added a print button to the form to send the report to the printer. The code is as follows:
Private Sub Command32_Click()
Docmd.SetWarnings False
'Docmd.OpenReport "rptAddresses", acViewNormal
Docmd.RunCommand acCmdPrint
Docmd.SetWarnings True
End Sub
Both alternatives in the code produce the same result described following.However, the printed report includes only the first 2 colums of about 10 of the 90 plus records. If I send to to a PDF, it works fine. If I do a print view on the screen ir looks fine.
View 1 Replies
View Related
May 3, 2013
Using Access 2013. I'm trying to do some conditional formatting on a field. I select the field in design or layout mode. I go to the Format menu, and Conditional Formatting (which is NOT greyed out). When I click on the Conditional Formatting option, nothing happens. What the heck? Where is the dialog?
I've rebooted my system, and tried every database I have (even created a new one), and I can't get the conditional formatting dialog to appear. Is there something stupid I'm overlooking? Do I need to have something in place before I can bring up the dialog?
View 14 Replies
View Related
Aug 22, 2013
Is there a way to get information in the print dialog box (File -> Print)? Like when i click ok or cancel? Or any other way that i will be able to know that the report is sent to printer or being printed.
View 2 Replies
View Related
Sep 19, 2013
I'd like to directly print a report from a button on a form.
I want to click the button and the report just prints to my default printer without any other user interaction.
Currently the print dialog appears but I don't want it.
View 3 Replies
View Related
Jul 21, 2015
My 'print' icon prints whatever is on the page as soon as it is clicked.
I'd like it to show the print dialog detailing which page / how many copies / which printer and so on.
how to do this?
I tried to customize the toolbar by adding the print icon from the File toolbar , but this is the same 'straight-to-print' as I already have.
View 3 Replies
View Related
Jul 23, 2007
Hi,
I have recently learned the use of 'ysnprint' (I am a novice), but wondered if there was an a way of selecting individual adresses in my db to exclude from the full address label printing.
Thanks for any help
Adrian
View 3 Replies
View Related
Jun 2, 2005
I need print records selected in a REPORT, of continuos forms. this is example
http://www.mundoimei.com/Images/form.JPG
please help me!!! :confused: :confused:
View 5 Replies
View Related
Dec 17, 2004
Access 97.
Not sure if this is the right area to post this question in, but here goes....
I want to print mailing labels but I only want to print selected names from my database, not every name in the database.
How do I do this?
Make it simple, please.
Thanks.
View 1 Replies
View Related
Jul 11, 2014
I am trying to print selected query how can I do that what is the command for that ...
View 1 Replies
View Related
May 8, 2013
I am using access 2010 and have made a simple database for the company I work for. This consists of the a table of the raw data and a form to make the data printable.
I have been asked by our admin person if I can make it possible to be able to print labels from it. I know it is possible via the wizard but very limited.
What we really need is to be able to select the people from the table that we want labels for.
I have added a true/false check box to the table called 'label?'
View 7 Replies
View Related
Aug 10, 2015
I am trying to get a report to print out one one record that I want.. I want it to be able to be sorted by date and the user just picks a date and one record is printed out on page. Right now every record that is stored is being printed on a different page and over time that is going to be a lot of paper... I want to be able to pick which record I want printed...
The Form is called "Bread Mold"
The report is called "Bread Mold Report"
The table is called "Bread Mold"
What it is sorted by is called "Swab Date"
View 13 Replies
View Related
Apr 1, 2015
Now the fundamental point of my Database is to take bookings, calculate the costs and print out the bills.
It all works jim dandy...BUT I havent done it in a elegant way.
So I just want to streamline the database and make it more user friendly so my Dad could also use it.
I have a Switchboard with Buttons which functions as Navigation and below that I have a subform which is based on query from my Bookings table to show my current, future bookings etc.
I want to be able to click on a record in the subform and press a button to open the report in print preview mode without having to input the booking nr.
Funnily enough I have actually found an example database which has this function but its more complex (it does it in 2 stages, so the user can still input more data in the report if required) rather than going directly to the print preview. I looked through the settings but its difficult when you dont really know what to look out for.
I have tried 2 things so far:
-Creating a macro with the OpenReport command but when I ran the macro it still wanted the Booking Nr manually inputted.
- I tried a VBA code but that gave me errors and I wasnt able to debug it.
I read some things regarding the "Link Child/Master Field" but I dont know if I even need that...I *think* that is more for pulling info from the Master form to show the related data in the subform.
View 12 Replies
View Related
Nov 25, 2014
A while ago I started to use the following code to list the printers installed on a computer. This is code by Wayne Phillips.
This works well, but what if instead of simply getting a big message box with all the printers listed I wanted to be able to click on a name and set that printer? How do I do that?
Code for the button:
Private Sub cmdListPrinters_Click()
Dim strCount As String
Dim strMsg As String
Dim prtLoop As Printer
On Error GoTo ShowPrinters_Err
[Code] ....
View 2 Replies
View Related
Mar 7, 2014
Is it possible, within an OnOpen even of a specific report, to set the printer selection and page setup (size, margins, etc.) to certain things? If so, how would I go about accomplishing this?
I would like to do this for specific users within our domain (this I won't have any trouble with).
View 9 Replies
View Related