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!

Reports - Page Setup on open 3

Status
Not open for further replies.

DH

Programmer
Dec 8, 2000
168
0
0
I have designed several reports using page setup properties of legal size paper and landscape.

The problem is that when the application is distributed and a user goes to view one of these reports for the first time the report somehow defaults back to letter size paper on the installation machine. Therefore the report doesn't look correct.

To fix this the user has to manually each time go into page setup properties and change the paper size back to legal the way it should be.

Is there a way to tell the report to use legal size??? When the report is being opened???

Any suggestions?

Thanks.
 
AHHHH I have been waiting for this question. I should have posted it as a tip. This is a bug in 97 AND 2000. It is some funky thing that happens when the option to "track name auto correct" is checked in the general option tab. Sounds odd, but trust me on this one. Anyway, you can turn that off and it should solve it temporarily, but if you go to microsoft's web site, and look up the problem in the knowledge base it will tell you how to download the SR-1 and SR-2 updates that fix the bug. I have had hours and hours of he-- with this one, . I want a star!!LOL If you need more info, please feel free to ask.
 
Glad to see that someone else out there has experienced this. I have been wondering for quite some time on how to fix this.

Thank you very much for your prompt answer.



 
First off...hi! New to the board. Looks like a good one.

Secondly, thanks (belatedly) dawnd3 for the answers. This has been driving me crazy -- especially because of the sporadic nature of this problem!

Anyway...I have a question about the ms patch and/or the workaround (i.e. turning off Name Autocorrect). The database I'm working on is deployed to my client as a .mde file installed on a network drive. Many users then run this db, but via copies of Access installed on their own machines. The question is: if I use the workaround or install the patch on my own development machine, and then create the .mde file there, is the Page Setup stuff going to be stable once deployed (considering that the copies of Access that'll be running this .mde file will not necessarily have the patch or the workaround set up)? Or, do I need to ensure that all copies of Access have the fix implemented?

Thanks.
 
To solve this problem, I used a short brute force technique by employing SendKeys, thus I don't rely on any service releases, etc... A con to this is that it is brute force & rather "hard coded".
If your dBase has lots of reports, using a great variety of orientations & letter sizes, you will need to employ a technique for determining when to call this function & when not to.
Note that SendKeys does need to come right before the DoCmd.RunCommand acCmdPageSetup in order to work correctly. I'm not sure why, but if you switch the order - it's no good.

use this code at will...hopefully it's helpful,
- jmahr

Code:
'-------------------------------------
' SetPageToLandscape
'
' This Function forces page orientation to landscape using
' legal width - needed because sometimes the reports,
' when first run, only set landscape to letter width
' paper, instead of legal pad width.
'-------------------------------------
Function SetPageToLandscape()
On Error GoTo SetPageToLandscape_Err

    SendKeys "{RIGHT}{TAB 2}{L}{TAB 3}{ENTER}", False
    DoCmd.RunCommand acCmdPageSetup

SetPageToLandscape_Exit:
    Exit Function

SetPageToLandscape_Err:
    MsgBox Err.Number & vbCrLf & Err.Description, vbCritical, "Error Message"
    Resume SetPageToLandscape_Exit
    
End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top