|
-
Mar 9th, 2007, 03:53 PM
#41
Re: printing access reports using vb.net
There should be a print to and print from argument of the .Print method. Or how are you invoking the print as of now?
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 
-
Mar 9th, 2007, 04:41 PM
#42
Thread Starter
Lively Member
Re: printing access reports using vb.net
-
Mar 9th, 2007, 04:42 PM
#43
Thread Starter
Lively Member
Re: printing access reports using vb.net
this is all my code, maybe that tells you what you need:
Code:
Option Explicit On
Option Strict On
Imports Microsoft.Office.Interop
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents btnAfdrukken As System.Windows.Forms.Button
Friend WithEvents Button1 As System.Windows.Forms.Button
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.btnAfdrukken = New System.Windows.Forms.Button
Me.Button1 = New System.Windows.Forms.Button
Me.SuspendLayout()
'
'btnAfdrukken
'
Me.btnAfdrukken.Location = New System.Drawing.Point(96, 24)
Me.btnAfdrukken.Name = "btnAfdrukken"
Me.btnAfdrukken.TabIndex = 0
Me.btnAfdrukken.Text = "Afdrukken"
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(264, 24)
Me.Button1.Name = "Button1"
Me.Button1.TabIndex = 1
Me.Button1.Text = "Button1"
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(680, 502)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.btnAfdrukken)
Me.Name = "Form1"
Me.Text = "Form1"
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub btnAfdrukken_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAfdrukken.Click
Dim moApp As Access.Application
Dim acViewPreview As Access.AcView
Try
moApp = DirectCast(GetObject(, "Access.Application"), Access.Application)
Catch ex As Exception
If TypeName(moApp) = "Nothing" Then
moApp = DirectCast(CreateObject("Access.Application"), Access.Application)
Else
MessageBox.Show(ex.Message, "VB/Office Guru™ Access Demo", _
MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
End If
End Try
'moApp.Visible = True
moApp.OpenCurrentDatabase("C:\Documents and Settings\Joris\Bureaublad\Nieuwe map\GGIP\BierDatabase.mdb")
moApp.RunCommand(Access.AcCommand.acCmdAppMaximize)
moApp.DoCmd.Maximize()
moApp.DoCmd.SetWarnings(False)
moApp.DoCmd.OpenReport("rptBier", acViewPreview)
moApp.CloseCurrentDatabase()
End Sub
End Class
-
Mar 9th, 2007, 04:45 PM
#44
Re: printing access reports using vb.net
Well you are previewing the report so if the user clicks print from the Access toolbar then it will print all pages. If they use the Print... from the File manu then they can designate the pages to print.
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 
-
Mar 9th, 2007, 04:57 PM
#45
Thread Starter
Lively Member
Re: printing access reports using vb.net
Actually, it's not previewing anything, not even before I added the CloseCurrentDatabase.
It all has to work out of the program, this fatso is too much of a lazy bum to learn how to use access, so I gotta make it in vb for him. So no file menu for me I guess..
-
Mar 9th, 2007, 05:11 PM
#46
Thread Starter
Lively Member
Re: printing access reports using vb.net
I'm out for today, it's getting kinda late.
I'll see you tomorrow I hope .
My personal vb hero ^^
-
Mar 9th, 2007, 05:45 PM
#47
Re: printing access reports using vb.net
Np.
There are two things more you can do.
One: filter the reportsource query to only produce the final printed recordset needed and then .OpenReport passing the Normal view argument which is print.
Two: call the printout method but that will print all the pages.
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 
-
Mar 10th, 2007, 11:50 AM
#48
Thread Starter
Lively Member
Re: printing access reports using vb.net
and how do I make that filter?
-
Mar 10th, 2007, 02:44 PM
#49
Re: printing access reports using vb.net
Add a where clause to the sql query that is your reportsource.
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 
-
Mar 10th, 2007, 06:04 PM
#50
Thread Starter
Lively Member
Re: printing access reports using vb.net
I'll see what I can do.
Questions to come later
-
Mar 10th, 2007, 07:05 PM
#51
Re: printing access reports using vb.net
Ok, maybe in a new thread as its a bit of a different topic. Plus, other members may be more inclined to help in a new thread instead of reading through tweo pages of the original topic.
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 
-
Mar 11th, 2007, 03:54 AM
#52
Thread Starter
Lively Member
Re: printing access reports using vb.net
Ok, but still in the end thisis what the program is supposed to do, just so we're on the same page.
Start up a self-made program, view the database in datagrids and be able to edit the database (already done).
Be able to search something inside the same program using terms like "bee".
Then the program should search everything which corresponds to *bee*.
Be able to print the record which was looked up by the search function in the form of a report. Or either just be able to view the reports one by one in the program and print one to your own choice out.
Last one: if you click "go back" in a window of the program after you made changes to the database, but didn't click on update there should be a pop-up window asking wether you want to quit, or go back and save the changes.
Ofc if you click go back to save changes, you should go back and be able to save the changes.
This is just what my program has to do in the end. Is it possible?
-
Mar 11th, 2007, 04:05 AM
#53
Re: printing access reports using vb.net
Second to last item, if they are to select a record out of the report then it should not be in a report (report records are not selectable in preview mode). Create a secondary form to display the query results and then what ever they check you can pass to the report for printing.
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 
-
Mar 11th, 2007, 04:23 AM
#54
Thread Starter
Lively Member
Re: printing access reports using vb.net
As long as it all happens inside the program, it's good.
-
Mar 11th, 2007, 09:55 AM
#55
Thread Starter
Lively Member
Re: printing access reports using vb.net
Em like??
the report corresponding to the record you selected in the datagrid I mean.. not a record out of a report. I'm not that stupid.
Last edited by frederik; Mar 11th, 2007 at 10:35 AM.
-
Mar 11th, 2007, 11:16 AM
#56
Re: printing access reports using vb.net
I think its not checkable under the previous Access versions but test it just in case. 2007 you can check a checkbox in a report in preview view.
Ps, didnt mean it that way.
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 
-
Mar 11th, 2007, 01:06 PM
#57
Thread Starter
Lively Member
Re: printing access reports using vb.net
Well, I'm going to come back at this on monday, after I saw my teacher. She might give a hint.
-
Mar 12th, 2007, 11:58 AM
#58
Thread Starter
Lively Member
Re: printing access reports using vb.net
Ok, no hints :'(
Is there a way to view the report inside the program?
EVERYTHING HAS TO HAPPEN INSIDE THE PROGRAM, just to stay on the same page
-
Mar 12th, 2007, 12:07 PM
#59
Re: printing access reports using vb.net
So you are saying that you can not display Access at all?
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 
-
Mar 12th, 2007, 02:05 PM
#60
Thread Starter
Lively Member
Re: printing access reports using vb.net
Yes, that's what I'm saying.
I think I got a crap work for school btw, I didn't choose to do this.
-
Mar 12th, 2007, 03:14 PM
#61
Re: printing access reports using vb.net
If you can not display Access at all then you can not use any of the code. this was in some of my first posts.
Since you need to show "a" report you need to use something else to display it like just a data grid, data environment report designer, or ???
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 
-
Mar 13th, 2007, 10:24 AM
#62
Thread Starter
Lively Member
Re: printing access reports using vb.net
I used a grid for my tables, I don't know what's best for reports.
Any idea's?
ps: sorry, thought it was clear everything had to happen inside the program.
-
Mar 13th, 2007, 02:26 PM
#63
Re: printing access reports using vb.net
You could print the report directly to a secondary form or use the print preview control dialog.
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 
-
Mar 13th, 2007, 03:04 PM
#64
Thread Starter
Lively Member
Re: printing access reports using vb.net
Which would be easiest to implement? Because I have to understand what I'm writing here, otherwise it's not very learnful.
-
Mar 13th, 2007, 04:12 PM
#65
Re: printing access reports using vb.net
Either one is about the same difficulty, not too easy but in .net
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 
-
Mar 13th, 2007, 04:53 PM
#66
Thread Starter
Lively Member
Re: printing access reports using vb.net
Ok, then either one is fine, choose which you can explain best to someone like me. I'm off to bed, have to get up at 3.45 tomorrow, night night.
-
Mar 14th, 2007, 04:55 PM
#67
Thread Starter
Lively Member
Re: printing access reports using vb.net
NOOOOOEEEES my personal vb hero/guru left me!!
-
Mar 18th, 2007, 04:55 PM
#68
Re: printing access reports using vb.net
No, I have been out for a while but should be back now.
Try using the printpreview dialog control. There are some examples on the MS site for it. Try a search.
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 
-
Mar 19th, 2007, 02:20 PM
#69
Thread Starter
Lively Member
Re: printing access reports using vb.net
-
Apr 3rd, 2007, 01:58 PM
#70
Thread Starter
Lively Member
Re: printing access reports using vb.net
Ok, I tried looking, and I couldn't really find any examples which include access except for this one, I put my database in the samples map and replaced every northwind which wasn't in comment into the name of my database, and it doesn't work yet, I know I'll have to change some extra stuff, looking all of that up right now, but still, this code displays acces.
So maybe can you explain about the printpreview control dialog and other stuff?
And my teacher won't answer for the next 2 weeks, it's vacation now that's good and bad news..
Maybe if you add me on msn it's easier to explain than 40 posts, I know I'm not fast sometimes which doesn't make it easier.
Mine is [email protected] if it's ok by you, elseway we'll just use posts, slower but it'll work .
-
May 12th, 2007, 07:28 AM
#71
Thread Starter
Lively Member
Re: printing access reports using vb.net
After 3 weeks still no answer, is this thread abbandoned? Right now I've got 4 days left, and I still don't know how to select the exact pages to print from the report. Right now it just prints all, and it's by code (yours). Can you explain me how to do this by the print preview control dialog?
This is the code I used from you btw, not that it matters anymore I think.
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim moApp As Access.Application
Dim acViewPreview As Access.AcView
Try
moApp = DirectCast(GetObject(, "Access.Application"), Access.Application)
Catch ex As Exception
If TypeName(moApp) = "Nothing" Then
moApp = DirectCast(CreateObject("Access.Application"), Access.Application)
Else
MessageBox.Show(ex.Message, "VB/Office Guru™ Access Demo", _
MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
End If
End Try
moApp.Visible = True
moApp.OpenCurrentDatabase("V:\Users\Frederik\Desktop\Bierdatabase met rapport.mdb")
moApp.RunCommand(Access.AcCommand.acCmdAppMaximize)
moApp.DoCmd.Maximize()
moApp.DoCmd.SetWarnings(False)
moApp.DoCmd.OpenReport("rptBierengoed", acViewPreview)
moApp.CloseCurrentDatabase()
End Sub
-
May 12th, 2007, 08:05 AM
#72
Thread Starter
Lively Member
Re: printing access reports using vb.net
Ok, I'm editing this for resolved, I edited the code a bit more to add a printrange, and now it works like a charm. I'll still have to remove bits and pieces, but this is what I got for now.
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim moApp As Access.Application
Dim acViewPreview As Access.AcView
Dim begin As Integer
Dim einde As Integer
begin = CInt(TextBox1.Text) + 1
einde = CInt(TextBox2.Text) + 1
Try
moApp = DirectCast(GetObject(, "Access.Application"), Access.Application)
Catch ex As Exception
If TypeName(moApp) = "Nothing" Then
moApp = DirectCast(CreateObject("Access.Application"), Access.Application)
Else
MessageBox.Show(ex.Message, "VB/Office Guru™ Access Demo", _
MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
End If
End Try
moApp.Visible = True
moApp.OpenCurrentDatabase("V:\Users\Frederik\Desktop\Bierdatabase met rapport.mdb")
moApp.RunCommand(Access.AcCommand.acCmdAppMaximize)
moApp.DoCmd.Maximize()
moApp.DoCmd.SetWarnings(False)
moApp.DoCmd.OpenReport(ReportName:="rptBierengoed", _
View:=Access.AcView.acViewPreview)
' Print a report named Sales:
moApp.DoCmd.OpenReport(ReportName:="rptBierengoed", _
View:=Access.AcView.acViewNormal)
moApp.DoCmd.PrintOut(Access.AcPrintRange.acPages, begin, einde, Access.AcPrintQuality.acHigh, 1)
'moApp.DoCmd.OpenReport("rptBierengoed", Access.AcView.acViewPreview)
moApp.CloseCurrentDatabase()
End Sub
The +1 on beginning and ending is because the number 1 report is empty.
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
|