Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OutputTo method... (VBA)

Status
Not open for further replies.

SiJP

Programmer
Joined
May 8, 2002
Messages
708
Location
GB
Hi..

Im trying to output a report in which Im suing the following line of code:

DoCmd.OutputTo acOutputReport, strReportName, , _ strOutputLocation, 0

As you can see, I've not included the format I want to output to. The reason being is that I want to output to a SnapShot file.

If I leave this part of the code out, I get a prompt to say what format I would like to output to and this includes the snapshot file... thats all fine and dandy however I cannot find the right object constant to hard code (ie preventing the user making another choice as I dont want other file types used).

My options that access provides are:

acFormatActiveXServer (asp page)
acFormatHTML (HTML Page)
acFormatIIS (server page)
acFormatRTF (Rich text page)
acFormatTXT (text document)
acFormatXLS (spreadsheet.....)


What would be my pot of gold would be for an acFormatSNP...

As I can't have this (to my knowledge) I would appreciate any alternatives.

Thanks!
 
I believe the syntax is acFormatSnapShot.

Even though it is not display, it should work. Programming isn't a profession of choice.
It's a profession of calling...
"Hey Programmer, your application broke again!" [spin]

Robert L. Johnson III, A+, Network+, MCP
robert.l.johnson.iii@citi.com
 
Thanks for the suggestion, however, this is not correct - the error message "Variable not Defined" appears to haunt me!

DoCmd.OutputTo acOutputReport, strReportName, acFormatSnapShot, strOutputLocation, 0

Are there any other routes please?
Thanks!

=
Your good friend will come out in the middle of the night to bail you out of jail.. your best friend is in the next cell hollerin "Dude, that was awesome!"
==
 
Try this variation. I created a macro to output a report to snapshot format then used the 'Save as' feature to convert the macro to VBA.
The resulting resulting code was:
DoCmd.OutputTo acReport, strReportName, "SnapshotFormat(*.snp)", strOutputLocation, False.
You could create a global constant with the value = "Snapshot Format (*.snp)" and substitute that in the DoCmd statement.
 
Thanks again for the suggestions..

Robert - again i have no option in the macro to output to snapshot. Perhaps i'm not undertanding your method right?

JEJ1003 - Unfortunately this returns variable not defined also.

Thanks
 
Has anyone any further tips please!!!!

Thanks
Simon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top