Wish to hide the output window (1 Viewer)

rosenn

Registered User.
Local time
Today, 03:33
Joined
May 6, 2002
Messages
45
In A2000, with VB6.0,

I use the following line to save a report to a file.

DoCmd.OutputTo acOutputReport, "rptMABriefList", acFormatRTF, Filename

Works just fine. I want this process to be automatic and hidden from the user, but a window pops up with a "Cancel" button. I don't want to allow the user the cancel option, and I'd prefer to have that pop-up window be invisible. Can I do either of these things:

1. Prevent that window from popping up (or make it invisible)

in lieu of that,
2. Change that popup window to have no Cancel button.

Any help appreciated.
 

ColinEssex

Old registered user
Local time
Today, 03:33
Joined
Feb 22, 2002
Messages
9,128
DoCmd.SetWarnings False
DoCmd.OutputTo acOutputReport, "rptMABriefList", acFormatRTF, Filename
DoCmd.SetWarnings True
 

rosenn

Registered User.
Local time
Today, 03:33
Joined
May 6, 2002
Messages
45
No luck

Thanks for the reply. That didn't work. The DoCmd essentially prints the list to the file, so a printing box appears. It is this box that I am trying to suppress. It doesn't prompt the user for anything, and is fairly innocuous. However, it does offer a cancel button. I deal with that by handling the error (#2501) it generates however I'd rather the user never see the box in the first place.

Any other ideas out there?

I searched this topic already. Someone asked how to hide the printer "splash" box - a term I am not familiar with. He had no replies on that one.

-N
 

ColinEssex

Old registered user
Local time
Today, 03:33
Joined
Feb 22, 2002
Messages
9,128
Oh right - I thought it was just a normal message box :rolleyes: I'm afraid I'm not sure how do what you're asking. Hang in there, maybe someone who has actually done this may be of help to you.

Col
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 22:33
Joined
Feb 19, 2002
Messages
43,474
I don't get a message box so I don't know what you're talking about. Cancel what? What does your reference to VB6 have to do with this? Are you executing this command from a VB6 program rather than from an Access db?
 

rosenn

Registered User.
Local time
Today, 03:33
Joined
May 6, 2002
Messages
45
Thanks for replying; let me clarify.

Thanks for your reply to my plea for help, and sorry for not enough detail. My database is currently in Access 2000 (with visual basic version 6.0).

On my main switchboard form, in the on timer event I have a routine that automatically saves a report. Once it's saved, it won't do it again until the next day. This automatic save feature is turned on or off by a setting in a table of administrative items. The idea is for the autosave feature to archive a daily copy of a patient list, so that the average user doesn't worry about it, and should not be allowed to screw it up.

The report is saved with a DoCmd OutputTo line that I mention in the first post of this thread. When the line runs, a "Printing" box pops up with a cancel button on it. If the user hits the cancel button, it generates an error, which I handle easily and is not a problem. What I am trying to achieve is something cleaner and more user friendly - hiding this "Printing" box completely so that the user never sees it. That's my goal.

I see 3 possibilites:

1. What I desire is impossible
2. I should be saving the report with some different method so that the printing box never pops up
3. There is a way of suppressing the box or hiding it, or removing the cancel button

Any ideas?
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 22:33
Joined
Feb 19, 2002
Messages
43,474
If your application is an Access database, you are working with VBA NOT VB6. VBA and VB are closely related. However, they are not identical especially when dealing with visual objects such as forms. If your front end is VB then you need to ask your questions in a VB forum. The fact that your data is in Access tables is not relevant.

Regardless of the software used to create your application, you do not need to save copies of "printed" reports to archive info. A query wilh a parameter should be able to select data from any range of dates.
 

rosenn

Registered User.
Local time
Today, 03:33
Joined
May 6, 2002
Messages
45
Not trying to reinvent the wheel

Thanks for the clarification - you are of course correct - I am working in VBA. What threw me was in the 'about ms visual basic', it said 'visual basic 6.0', but down at the bottom of that window it does say VBA.

I am totally open-minded as to the best way to save the information I wish to save. The reason I'm saving a report is because that contains exactly the information I wish, and it is acceptable to have it in the textfile format; in fact, it's preferable.

The database is a medical patient database, each patient having a potentially infinite number of admissions. The daily census list is a made from a query that pulls in all of the patients who have admissions that have no date of discharge - those folks who are presently admitted to the hospital.
I make the daily patient list report from that query. I then save that report every day with a new filename that is a concatenation of 'list' and that day's date. My only problem, and it's a super subtle one, is that during this save process, which is done with the DoCmd.OutputTo line, there appears a dialog box with a 'cancel' button. I can handle the error generated by clicking the button and make it fool-proof, but if there is a way to avoid it in the first place, it would be cleaner and simpler.

What do you think?
 
K

Kat001

Guest
Just a thought, but it seams to me that it would be much easier just to save the results of your original query, directly in the format you need (.rtf)

The reason I'm saving a report is because that contains exactly the information I wish, and it is acceptable to have it in the textfile format; in fact, it's preferable.

Try this:

DoCmd.OutputTo acOutputQuery, "Your Query name here", acFormatRTF, "C:\Temp\Test.rtf (Change to your file & Path)", False

...with this you will get no popup window for the user to see.
You can also add your own variable into the above line of code to include the current date automatically in the output file name.

Hope this helps....
 

rosenn

Registered User.
Local time
Today, 03:33
Joined
May 6, 2002
Messages
45
This definitely helps

Thanks for the good suggestion. The problem is that the query, as presently designed, is not ready to go directly into textfile format. But that is only a small problem that is easily fixed. What this did do was eliminate the pop-up window, and that's really nice.
 

raskew

AWF VIP
Local time
Yesterday, 21:33
Joined
Jun 2, 2001
Messages
2,734
Nelson-

There's a design issue here.

There's no need to save each report -- that's what queries

are all about. You can replicate a census report for any date

with something like (using dteIn, dteOut as the admission and

discharge dates) -- aircode here:

...WHERE dteIn<= [Input Date] AND (IsNull(dteOut) OR dteOut >= [Input Date])

Saving each day's report just results in database bloat and

serves no useful purpose.

Bob
 

rosenn

Registered User.
Local time
Today, 03:33
Joined
May 6, 2002
Messages
45
You're right

Now that I hear what you're saying, it becomes obvious. I had an early approach that achieved through brute force a service that I should have been offering the user with a well designed query.

I need to work on this one, but it will end up being better than saving all those daily lists.
 

Users who are viewing this thread

Top Bottom