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

Screen not maximized when getting focus 1

Status
Not open for further replies.

EddyLLC

Technical User
Joined
Mar 15, 2005
Messages
304
Location
US
I have the following line of code on the OnClick property of a command button just to preview a report.

DoCmd.OpenReport stDocName, acPreview

Everything works fine until I close the preview screen. When done my previous form gets focus and it is not centered. I can only see half the form and must use the scroll bars to move the form into view. I tried using DoCmd.Maximise in the forms On Activate property. It works but the form seems to do a lot of jumping when loading.

Is there a form setting I can use so when I come back from a print preview screen the form is full screen?


 
EddyLLC,

You could try DoCmd.Maximize or DoCmd.Restore in the report's Close event. Or you could play with DoCmd.MoveSize.

Ken S.
 
Thanks for the help. I haven't time to play with the DoCmd.MoveSize now and brief testing was not hopeful with the restore and maximize. I simply put the Maximize back in the orininal form and will put up with the form jumping for now.

Thanks again.
Eddy
 
Hi Eddy,

Try Me.maximize on the form's Activate property.

Cheers,
Bill

 
He's already tried that, Bill! See the original post!

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
How are ya EddyLLC . . .

In the [blue]Close[/blue] event of the [blue]Report[/blue]:
Code:
[blue]   Forms![purple][b][i]FormName.SetFocus[/i][/b][/purple]
   DoCmd.Maximize[/blue]
Don't forget to [blue]disable[/blue] the forms [blue]Activate[/blue] event . . .

Calvin.gif
See Ya! . . . . . .
 
Sorry, but now I've read the full post.

I'm not sure that moving the Docmd.maximize will have much effect on the "form jumping". What events are firing when the form regains focus? Try stepping through the code to see what is happening. If you are triggering the form's OnCurrent event or otherwise triggering form/control repaints, then perhaps turning off (and then turning on) the echo or repaint activities will help.

Application.echo false
Application.echo true

Me.repaint = false
Me.repaint = true

VBA help gives relatively lucid explanations of these methods.

Cheers,
Bill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top