Hi,
I have a database which allows users to either Print, Preview or Export their reports, using the OpenReport command for the Print and Preview and the OutputTo command for Exporting.
Everything was running smoothly until i added a wherecondition to the Docmd.OpenReport line in VBA. Now the print and preview function works fine but i have found that there is no wherecondition in the OutputTo command.
I've looked around to see if there is any way around this but no luck, is there any way of specifying this where clause when exporting ?
4 3188
Hi, I think I have a solution for you. I ran into a similar problem before where I wanted the user to have a choice between print preview or output to HTML.
strDoc = name of the report you want to open
strLinkCriteria = your where statement -
DoCmd.OpenReport strDoc, acViewPreview, , strLinkCriteria, acHidden
-
DoCmd.SelectObject acReport, strDoc
-
'Fill in your parameters for the DoCmd.OutputTo
-
DoCmd.OutputTo acOutputReport, strDoc, , , ,
-
DoCmd.Close acReport, strDoc, acSaveNo
-
Hi, I think I have a solution for you. I ran into a similar problem before where I wanted the user to have a choice between print preview or output to HTML.
strDoc = name of the report you want to open
strLinkCriteria = your where statement -
DoCmd.OpenReport strDoc, acViewPreview, , strLinkCriteria, acHidden
-
DoCmd.SelectObject acReport, strDoc
-
'Fill in your parameters for the DoCmd.OutputTo
-
DoCmd.OutputTo acOutputReport, strDoc, , , ,
-
DoCmd.Close acReport, strDoc, acSaveNo
-
Swift Reply, im impressed ! Will try it tomorrow morning..
Hope it works out for you. The print preview will be shown briefly while the report is being outputted but the last line closes that and you're left with your filtered report in the output format of your choice.
Hope it works out for you. The print preview will be shown briefly while the report is being outputted but the last line closes that and you're left with your filtered report in the output format of your choice.
Aye, it works very well thanx...
Sign in to post your reply or Sign up for a free account.
Similar topics
by: tmountjr |
last post by:
I've got a user who's trying to export a text file with unicode
formatting. When he exports it as straight ascii, some of the foreign
characters (mostly just accent marks and the like - no...
|
by: sara |
last post by:
I have reports that run from a form where the user can choose a date
range, or they run automatically for a week in the "Weekly Reports"
option.
I created 2 queries and 2 reports - one query...
|
by: ljungers |
last post by:
Anyone have an idea how I can filter a report that I'm outputting to Word.
Using the following 2 Command to print and output to word.
The strWhere is a list of selected items/rows to print, and...
|
by: dancole42 |
last post by:
I have a question regarding the DoCmd.OutputTo function.
I have an invoice report that shows all of the invoices for a
particular date. I want to create a button that will export each page
of...
|
by: Jim Devenish |
last post by:
I have a report which can be displayed on the screen with:
DoCmd.OpenReport "RemittanceAdvice",acViewNormal,,"PaymentID = " &
paymentRecID
I now wish to create a snapshot of this, using the...
|
by: martin DH |
last post by:
**Urgent Need**
I'll throw out the basics and any assistance is very, very, very much appreciated!
Access 2003 on XP
On a form (frmMain) is an option group of check boxes (ReportFrame) from...
|
by: pdxrichard |
last post by:
Windows XP - Server 2003 - Access 2007 VBA - Code behind a form
Here is my code.
Why can't I find the exported file if the directories exist and there are no permission problems? Isn't a save...
|
by: MLH |
last post by:
Stephen Lebans has a function named ConvertReportToPDF
that I use from time to time. It's quite handy, actually. In that
FN is a line that reads as follows:
DoCmd.OutputTo acOutputReport,...
|
by: Carl Witte |
last post by:
Hello. I'm using Access '07 and I need to regulariliy put a PDF on a FTP site. Can I do this directly with the outputto command?
DoCmd.OutputTo acOutputForm, form_name, acFormatPDF,...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
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...
|
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...
| |