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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ACC2000: DoCmd.OutputTo Current Object

Status
Not open for further replies.

robz2009

Programmer
Apr 20, 2009
41
GB
I am working on a task to save reports to files and then send in an email which has been working ok but I have a problem with the DoCmd.OutputTo command.

I have searched extensivley on the net and it seems that you cannot apply a filter to the DoCmd.OutputTo like you can when using DoCmd.OpenReport. So the workaround I am using is to still open the report via DoCmd.OpenReport but then use DoCmd.OutputTo referencing the current object. I have read resources that state if you leave the ObjectName as blank it references the current object i.e. my currently open report. This isn't working as I get an error "2487 - The Object Type argument for the action or method is blank or invalid."

Here is my syntax, am I doing something wrong or is it a limitaton in Access 2000?

DoCmd.OpenReport "Rep_SIQuery", acViewPreview, "Qy_SIQuery", "CallID = " & pubCallID

DoCmd.OutputTo acOutputReport, "", acFormatHTML, "C:\Transaction Dispute Log - " & Me.CallID & ".html", False

P.S. I get the same result when taking out the quotation marks for the ObjectName parameter in the DoCmd.OutputTo command.


 
I simply typed the same report name and it referenced the open report, works a treat. I'm assuming it was an Access 2000 limitation?

DoCmd.OpenReport "Rep_SIQuery", acViewPreview, "Qy_SIQuery", "CallID = " & pubCallID

DoCmd.OutputTo acOutputReport, "Rep_SIQuery", acFormatHTML, "C:\Transaction Dispute Log - " & Me.CallID & ".html", False
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top