Restore Form Position (Access 2010)

Closing it in code was to save doing it manually, which i seem to be doing all the time). I did look at tabbed form layout but reverted back. The scrollbar was disabled intentionally on the main form, believing it would (should) not move, and the subform would scroll.

Changing the tab order certainly seemed to have worked, the problem hasn't come back. I made the subform 37 and some controls at the top 0, 1 & 2. Was concerned that might duplicate something but didn't seem to matter.
 
Closing it in code was to save doing it manually, which i seem to be doing all the time). I did look at tabbed form layout but reverted back. The scrollbar was disabled intentionally on the main form, believing it would (should) not move, and the subform would scroll.

Changing the tab order certainly seemed to have worked, the problem hasn't come back. I made the subform 37 and some controls at the top 0, 1 & 2. Was concerned that might duplicate something but didn't seem to matter.

Hi. Glad to hear you’re okay now. Good luck with your project.
 
Much appreciated... going in leaps and bounds now
 
@kirkm
Its easy to minimise the navigation pane using code
Code:
Public Function MinimizeNavigationPane()

    DoCmd.NavigateTo "acNavigationCategoryObjectType"
    DoCmd.Minimize
        
End Function

Conversely you can restore to its previous size using
Code:
Public Function MaximizeNavigationPane()

    DoCmd.NavigateTo "acNavigationCategoryObjectType"
    DoCmd.Maximize
        
End Function

To do either of these 'on demand' you can add keyboard shortcuts to an Autokeys macro

However I agree with the previous comments that its more useful to just hide it.
 
Thanks Colin that'll be very handy. I found when it was hidden it couldn't be found.. but maybe I wasn't looking hard enough...
 
Not sure I understand that comment....
Have a look at my Controlling the Application Interface example database.
The modules modNavPaneTaskbar and modRibbon include code to show/hide the nav pane, ribbon and taskbar. The first two of these can also be minimised using code.
I include both modules in almost all apps. As already mentioned I also have an autokeys macro in several apps to create keyboard shortcuts for these procedures
 
Last edited:
Darn it, the problem has returned after running the query. The tab index settings are as changed (and worked before) ...but the Form is in the wrong place again (as in Msg 17). Also it has moved a wee bit to the left. Where there was a small area of grey each side of the subForm, now there's none on the left.
As there's no Left or Top property, how can the Form be told where to go ???
Should I try what DBGuy said (2. Move all your controls on the top of the form to the Form Header section.) Or would it be better to first find why this is happening ?
 
Mayberry post the latest version. But I don't think the tab order matters if you're setting the focus somewhere. I didn't download the 1st db so saying that is just a shot in the dark.
 
Last edited by a moderator:
Ok. I'll wait a bit just in case there's something else I can try first. Trimming it back will take me 30 mins or so.
 
I found (by accident) another button that's does something unrelated was restoring the Form correctly. Debugging proved it was the command Me.txtfocus.SetFocus.
This I use to remove focus from something that shouldn't have it (or keep it). It's set to 0 for Left, Top and Width.Adding that line to the end of routine that calls the query fixed it. Not sure if that's the correct way, but it works. Thanks to everyone who offered help.
 
I found (by accident) another button that's does something unrelated was restoring the Form correctly. Debugging proved it was the command Me.txtfocus.SetFocus.
This I use to remove focus from something that shouldn't have it (or keep it). It's set to 0 for Left, Top and Width.Adding that line to the end of routine that calls the query fixed it. Not sure if that's the correct way, but it works. Thanks to everyone who offered help.
Hi. Glad to hear you got it sorted out. Good luck with your project.
 

Users who are viewing this thread

Back
Top Bottom