Error 2585 This Action cannot be carried out ....

G

Guest

Error 2585 This Action cannot be carried out while processing a form or report

I have my orders form (frmorders) that I use for new orders and after all
the information is added the user clicks on a command button that allows them
to print the current order, rptcustomorder.

For the custom order report, I have it set up so that on close, I have the
following code to save the file to my hard drive:

begin code:

Private Sub Report_Close()
Dim strReportName As String
Dim strOutputName As String
strReportName = "rptcustomorders(I)"
strOutputName = DLookup("[OrdNum]", "qryinventory") & _
" - " & Format(Date, "dd/mm/yyyy")


DoCmd.OutputTo acOutputReport, strReportName, "Rich Text Format", _
strOutputName, True


End Sub

End Code....

From what i have read online this is due to the fact that the form is open
and trying to use the report?? am I correct?

how do I get around this error? do I need to close my form prior tothe save
event of the report and then reopen the form?

Any ideas? suggestions are appreciated... I have racked my brain with this
one...

Brook
 
W

Wayne Morgan

I'm not sure about the error. There is another error that I see and I don't
know if it is being misreported or if there are two errors. The other error
I see is the file name you're trying to use. A "/" is not a legal character
for a file name. You are appending the date to the file name using this
character in the format. Try "-" instead.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top