Hi!
I have experienced a a really odd problem when writing an Access application. I would programatically open a report (because i need to pass a value to it) with DoCmd.OpenReport. I would like to open it for viewing, not in print preview (as there the recordsource couldn't be modified anymore), like when you open it from the command bar with the button "Report View".
The odd thing is, that apparently there's no way to simply view the report without immediately printing it :-). I tried the code
DoCmd.OpenReport "ReportName", acViewReport, , , acWindowNormal, "value_to_pass"
with every view mode. As i know with acViewReport it has to display the report instead of printing it... Is this some bug or i am missing something?:
5 48420 nico5038 3,080
Recognized Expert Specialist
Use the Preview like:
DoCmd.OpenReport "ReportName", acViewPreview, , , , "OpenArgs"
Nic;o)
Use the Preview like:
DoCmd.OpenReport "ReportName", acViewPreview, , , , "OpenArgs"
Nic;o)
Thanks, that would do it, but as i have written, unfortunately it's not possible to modfiy the recordsource prooperty in print preview, so it's not possible either to make a report with a customized query.
I made a new try and have explored that with an open argument (even with an empty one) Access 2007 doesn't print. That's OK, but Access 2003 still does...
nico5038 3,080
Recognized Expert Specialist
When I want a "dynamic" recordset I just manipulate the query before activating the report.
In general however using a filter gives enough flexibility, but incase you really need the query to change use this code before the Docmd.OpenReport: -
Dim qd as DAO.Querydef
-
-
set qd = currentdb.querydefs("qryRptYours")
-
qd.SQL = "select x from tblY where x =" & Me.X
-
Getting the idea ?
Nic;o)
ADezii 8,834
Recognized Expert Expert
Thanks, that would do it, but as i have written, unfortunately it's not possible to modfiy the recordsource prooperty in print preview, so it's not possible either to make a report with a customized query.
I made a new try and have explored that with an open argument (even with an empty one) Access 2007 doesn't print. That's OK, but Access 2003 still does...
If you wish to make any modifications to a Report prior to actually Opening/Previewing it, open the Report Hidden first, make your changes, then Re-Open in the proper Mode. - DoCmd.OpenReport "rptEmployee", acViewNormal, , , acHidden
Thanks a lot to both of you, it works!
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: eddie wang |
last post by:
Excel open automatically without giving a dialog box option to
Open/Save/Cancel using filesys.createTextFile.
How to pop up the dialog box option to Open/Save/Cancel?
Thanks.
|
by: diskoduro |
last post by:
Hi!
I'm trying to get help to an unexpected problem that has appeared
while I was writing a new application.
I want to opeon a report of product sales by filtering previously from
a listbox in a...
|
by: Michael Dekson |
last post by:
Access 97.
I make a report and I want first to see report and then print report without
type CONTROL + P.
Can I make some button or can I see print button in toolbar meny.
Thanks
|
by: BFord |
last post by:
Using Acc2000, only the report itself not printing.
The following have been tested, with no problem:
1) the print drivers are fine.
2) printed the query (source of the report)
3) printed...
|
by: sonicfun2006 |
last post by:
I have SQL Server Database and MS Access 2003 is connected with ODBC. I have very large amount of records in various tables. The database is very dynamic as it changes every minute. I’m trying to...
| |
by: alexalok |
last post by:
Hi ,
I developing an application VS dotnet 2003 using C#. I want to use crystal report without using DSN,so that i can change Database on run time.
if anybody can help me.
thanx.
|
by: =?Utf-8?B?RnJhbmsgVXJheQ==?= |
last post by:
Hi all
I have problems printing a .rdlc report directly to the printer.
I have created such a report without Datasource, I just
fill some parameters in this report.
With the ReportViewer I am...
|
by: Phil Stanton |
last post by:
I am opening a report (in Preview) from a menu system
I use the following code if there is no data in a report
Private Sub Report_NoData(Cancel As Integer)
MsgBox "There are no errors in...
|
by: pacarv |
last post by:
I've created a database in Access 2003 with multiple reports that are accessable from the switchboard. The switchboard also has a print button. The user selects the report from the menu which then...
|
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,...
|
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...
| |
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,...
|
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...
|
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: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| | |