greetings VeeBees
What I want to do: interface presents lists of reports for user. user clicks buttons to view reports in preview. User closes report and is prompted with vbyesno if they wish to print the report. After choosing yes/no, user is returned to report menu.
Problem:
Using Access 2000 and trying to get this damn thing to work.
In the report I have an 'onclose' event to open the report menu ie:
DoCmd.OpenForm "ReportMenu", acNormal
OnOpen code for ReportMenu as follows:
DoCmd.Echo True
If printon = "" Then GoTo finish
response = MsgBox("do you wish to print the " & printon & " report?", vbYesNo)
If response = vbYes Then DoCmd.OpenReport printon, AcViewNormal
finish:
printon = ""
DoCmd.Restore
printon is a public string variable which is set to the name of the report being viewed. I've checked that this is working by putting a msgbox up.
The error being returned is:
"Run-time error 2585. This action
cant be carried out while processing a form or report event"
and highlights the print line.
the msgbox is coming up over the report preview ie before it has closed. I've tried a 'docmd.close acreport' prior to printing it but get the same error. I've tried doevents in a loop checking the openstate value before printing. I've tried pulling each and every hair from my head but still no luck.
Hello (hello, hello)...Is there anybody out there...?
Any insight from the gurus would be most welcome.
Cheers
xentaur.
What I want to do: interface presents lists of reports for user. user clicks buttons to view reports in preview. User closes report and is prompted with vbyesno if they wish to print the report. After choosing yes/no, user is returned to report menu.
Problem:
Using Access 2000 and trying to get this damn thing to work.
In the report I have an 'onclose' event to open the report menu ie:
DoCmd.OpenForm "ReportMenu", acNormal
OnOpen code for ReportMenu as follows:
DoCmd.Echo True
If printon = "" Then GoTo finish
response = MsgBox("do you wish to print the " & printon & " report?", vbYesNo)
If response = vbYes Then DoCmd.OpenReport printon, AcViewNormal
finish:
printon = ""
DoCmd.Restore
printon is a public string variable which is set to the name of the report being viewed. I've checked that this is working by putting a msgbox up.
The error being returned is:
"Run-time error 2585. This action
cant be carried out while processing a form or report event"
and highlights the print line.
the msgbox is coming up over the report preview ie before it has closed. I've tried a 'docmd.close acreport' prior to printing it but get the same error. I've tried doevents in a loop checking the openstate value before printing. I've tried pulling each and every hair from my head but still no luck.
Hello (hello, hello)...Is there anybody out there...?
Any insight from the gurus would be most welcome.
Cheers
xentaur.