Ed Walsh
asked on
Make an Access97 Report Default to Legal size Landscape.
I have a application I created in Access 97 & have it loaded on the server with 5+ stations using it. They all have a local printer & a network printer. They use local printer for small print jobs & network for larger ones. My problem is, I have reports that run on Legal size paper Landscape. But when they change printers, it resets the reports to letter size landscape. Is there a way to stop this? Can it be automaticly set set no matter if you change printers? This would seem like an easy answer but I can't figure it out!
Any help is appreciated.
Thank you.
Ed W.
Any help is appreciated.
Thank you.
Ed W.
sorry for that comment - I posted it in the wrong question
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
When I put this code in a Sub Procedure in Event "OnPage" of my report I get this error message.
Compile Error:Invalid Inside Procedure.
It is then highlights this line of code:
Type str_DEVMODE
Help!
Compile Error:Invalid Inside Procedure.
It is then highlights this line of code:
Type str_DEVMODE
Help!
Not too familiar with VBA eh.... alright then.....
Okay well when I said that you should add this code to the onPrint event what I meant
really was a call to this code. So in the onPrint event you should say
call SwitchOrient("YourREPORTNa me" As String)
the rest of the code should be put into a module so....
go to the module tab..... click new.... copy the code that I previously gave you and
paste it after the option explicit statement. That should be it....
Okay well when I said that you should add this code to the onPrint event what I meant
really was a call to this code. So in the onPrint event you should say
call SwitchOrient("YourREPORTNa
the rest of the code should be put into a module so....
go to the module tab..... click new.... copy the code that I previously gave you and
paste it after the option explicit statement. That should be it....
ASKER
Ok, I made a module & saved it as "Print on Legal paper and Landscape.
I put call SwitchOrient("rptVT_Others " As String) in OnPrint.
And ran it. Got an error message.
"Diary Daily Reports can't find the Macro."
I then tried
=call SwitchOrient("rptVT_Others " As String)
=SwitchOrient("rptVT_Other s" As String)
SwitchOrient("rptVT_Others " As String)
No luck, same error message.
I put call SwitchOrient("rptVT_Others
And ran it. Got an error message.
"Diary Daily Reports can't find the Macro."
I then tried
=call SwitchOrient("rptVT_Others
=SwitchOrient("rptVT_Other
SwitchOrient("rptVT_Others
No luck, same error message.
oppps, sorry about that. Just add the keyword "public" before the sub procedure.
ASKER
Ok, I made a module & saved it as "Print on Legal paper and Landscape.
I put call SwitchOrient("rptVT_Others " As String) in OnPrint.
And ran it. Got an error message.
"Diary Daily Reports can't find the Macro."
I then tried
=call SwitchOrient("rptVT_Others " As String)
=SwitchOrient("rptVT_Other s" As String)
SwitchOrient("rptVT_Others " As String)
No luck, same error message.
I put call SwitchOrient("rptVT_Others
And ran it. Got an error message.
"Diary Daily Reports can't find the Macro."
I then tried
=call SwitchOrient("rptVT_Others
=SwitchOrient("rptVT_Other
SwitchOrient("rptVT_Others
No luck, same error message.
Ack! Too much cut, copy, paste.
Call SwitchOrient("rptVT_Others ")
Call SwitchOrient("rptVT_Others
ASKER
Ok, I placed Call SwitchOrient("rptVT_Others ") in OnPrint.
I saved it & tried to run it. I get this error message.
Run-Time Error '2046':
The command or action 'OpenReport' isn't available now.
I then click DEBUG button & this line of code is highlighted.
DoCmd.OpenReport strName, acDesign ' Opens report in Design view.
If it makes a difference. The table that this report is getting its info from is a Linked Foxpro 2.5 Table. I have full rights to it.
Ed W.
I saved it & tried to run it. I get this error message.
Run-Time Error '2046':
The command or action 'OpenReport' isn't available now.
I then click DEBUG button & this line of code is highlighted.
DoCmd.OpenReport strName, acDesign ' Opens report in Design view.
If it makes a difference. The table that this report is getting its info from is a Linked Foxpro 2.5 Table. I have full rights to it.
Ed W.
ASKER
One other note.
OnPrint Event. I noticed that this event can be different for different Sections of the report. Ect, Page header/Footer, Report Header Footer,GroupHeader/GroupFo oter ect.
Where should it go?
In the events for the whole report there is no OnPrint Event.
Only:
On Open, On Close, On Activate, On DeActivate, On NoData, On Page, On Error.
I'm a bit confused on the proper place to put the
Call SwitchOrient("rptVT_Others ").
OnPrint Event. I noticed that this event can be different for different Sections of the report. Ect, Page header/Footer, Report Header Footer,GroupHeader/GroupFo
Where should it go?
In the events for the whole report there is no OnPrint Event.
Only:
On Open, On Close, On Activate, On DeActivate, On NoData, On Page, On Error.
I'm a bit confused on the proper place to put the
Call SwitchOrient("rptVT_Others
just comment out that line... I don't think you actually have to open the report.
hmmmm, I would try the report header onPrint event.
Best regards,
kulikuli