|
-
Apr 26th, 2005, 06:10 AM
#1
Thread Starter
Fanatic Member
[RESOLVED] VBA Printing from access
im using the following code to print the current record of the form
i was wondering if it is possible to specify in it which printer you would like to print to or display the print dialog even
Code:
Private Sub Print_Record_Click()
On Error GoTo Err_Print_Record_Click
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.PrintOut acSelection
Exit_Print_Record_Click:
Exit Sub
Err_Print_Record_Click:
MsgBox Err.Description
Resume Exit_Print_Record_Click
End Sub
Barry
Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
.NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0
SQL Server 2005/2000/SQL Server CE 2.0
If you like, rate this post
Compact Framework for Beginners
-
Apr 26th, 2005, 11:43 AM
#2
Re: VBA Printing from access
Here is how you can set a specific report to use a specific printer.
VB Code:
Dim oReport As Report
DoCmd.OpenReport "Report1", acViewPreview, , , acWindowNormal
Set oReport = Application.Reports("Report1")
Set oReport.Printer = Application.Printers(0) 'Change to printer index you desire.
DoCmd.PrintOut acSelection
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 27th, 2005, 06:08 AM
#3
Thread Starter
Fanatic Member
Re: VBA Printing from access
will that work for printing forms or just access reports
also how is it possible just called the print dialog from the file->print menu
Barry
Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
.NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0
SQL Server 2005/2000/SQL Server CE 2.0
If you like, rate this post
Compact Framework for Beginners
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|