473,401 Members | 2,139 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

i want to preview what i'm printing out

I want to print my access report from vb.net and I have the vb.net code below:

Expand|Select|Wrap|Line Numbers
  1. Sub PrintRelatorio()
  2. Dim oAccess As Microsoft.Office.Interop.Access.Application
  3. ' Start a new instance of Access for Automation:
  4. oAccess = New Microsoft.Office.Interop.Access.Application()
  5. ' Open a database in exclusive mode:
  6. oAccess.OpenCurrentDatabase(filepath:="C:\PM_GEA\GEA\tmp\FICH_Access\Link_GEA.accdb", Exclusive:=True)
  7. 'Preview a report named Sales:
  8. oAccess.DoCmd.OpenReport(ReportName:="rpt_Processo", _
  9.            View:=Microsoft.Office.Interop.Access.AcView.acViewPreview)
  10. ' Print a report named Sales:
  11. oAccess.DoCmd.OpenReport(ReportName:="rpt_Processo", _
  12.            View:=Microsoft.Office.Interop.Access.AcView.acViewNormal)
  13. End Sub
question #1 I want to use the sql query SELECT to chose what to print ou from my database in access,
Question #2 I want to preview what I'm about to print before it goes to the printer.

OBS: the code is working perfectly but it's printing all the data in my database instead of just one, and I can't preview the report
Mar 17 '15 #1
0 1040

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Paul Rubin | last post by:
How about adding a string interpolation method and a some print methods to strings. 'hello world'.print() => same as "print 'hello world'". With optional fd arg, print to file object 'hello...
7
by: Kamilche | last post by:
I'm pretty desperate to get color syntax printing. I just tried out the evaluation version of 'Komodo', which several people in here suggested, and its print features are terrible. The text is...
16
by: Neo Geshel | last post by:
I'm helping on a web site, and it's got our knickers in a knot. We're using the same basic CSS files (with mods) and same headers as from our other sites, but the "print preview" won't work...
2
by: Pkant | last post by:
I want to Print a txt file with this code : class Printing { PrintDocument prndoc = new PrintDocument(); PrintPreviewDialog ppd = new PrintPreviewDialog();
4
by: Gravy | last post by:
I have a requirement that I need to print a crystal report from ASP.NET. Now, the problem I have is that the default account for ASPNET_WP.EXE is ASPNET under windows XP. I want to change this to...
6
by: Siv | last post by:
Hi, I am getting into printing with VB.NET 2005 and want to implement the usual capability that a user can select a selection of pages. I have a report that is generated by my application that if...
8
by: Neo Geshel | last post by:
Greetings. BACKGROUND: My sites are pure XHTML 1.1 with CSS 2.1 for markup. My pages are delivered as application/xhtml+xml for all non-MS web clients, and as text/xml for all MS web...
2
by: Brad Pears | last post by:
I have a vb.net 2005 application and am using the print preview screen. This screen has a printer icon on it that the user can use to print the document currently being viewed. It uses the default...
1
by: drtitus7759 | last post by:
I have an access database with an extensive amount of VBA. I am creating reports based on queries and parameter forms. In the production database everything is modal and accessed via forms. No access...
0
by: Kerem Gümrükcü | last post by:
Hi, i use the code from this code sample on MSDN: for printing a 5 and sometimes 70 page text-only data: http://msdn.microsoft.com/en-us/library/ms404294.aspx The point is, that this is...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.