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

Form opens at bottom right of screen.

Status
Not open for further replies.

EddyLLC

Technical User
Mar 15, 2005
304
0
0
US
Here is a strange one. I have multiple forms in a db each of which has a buttons that first opens a main form and then closes the open form. They all work fine except one. When I press it the main form opens but it is not centered. The main form is only partially visible in the bottom right corner of the screen and I have to use the scroll bars to center the form. When I open up the main form from any other form it opens centered and maximised. The code I use is the same on every form, it is below.
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "SwitchMain"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, "frm1", acSaveYes

Any thoughts on why? Thanks
 
How are ya EddyLLC . . .

Just a guess at this point but what if you set the MainForms [blue]Auto Center property[/blue] to Yes! . . .

Calvin.gif
See Ya! . . . . . .
 
I agree with the AceMan's guess, but I have also run into this in the past where a form refuses to autocenter for no apparent reason even though the autocenter property is set correctly. I've gotten around it by using the MoveSize property on the Form Open event. (The only good thing about this is that it's rare that I've needed to do this!)
 
I'm curious about this. The OP seems to infer that the form itself opens towards the lower right corner of the screen, but then when he states he uses the "scroll bars" to center the form on the screen, I'm totally lost.

Scroll bars would be used to move the CONTENTS of a form around within the borders of the form. To actually MOVE a form, you'd use the title bar to drag it to another visual location on the screen itself. So I can't tell if he means the FORM isn't centered on screen, or the contents of the form aren't centering themselves correctly when the form opens.


Apart from the Autocenter property, which centers the form on the screen., there are a couple of reasons why the CONTENTS of a form would not be 'correctly centered' when the form is opened. Given a form with greater depth than the physical size of the form allows, which has vertical scroll bars to bring the other, lower part of the form in view, if the first TAB ORDER field (e.g. Zero in the Tab Sequence) is 'lower' than would be normally visible, then the form will adjust it's vertical presence to make that first field visible, scrolling the form detail area downwards. I remember encountering this a few years ago with a fairly deep form that refused to open with the 'top' visible - it was because the prior designer had added a new field near the bottom of the form, and inadvertantly set the tab stop sequence of it to zero (the Tab Index property).





--------------------------------------
"For a successful technology, reality must take precedence over public relations, for Nature cannot be fooled." - Richard P. Feynman
More Access Help:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top