A2007 VBA to minimize / restore a specific form

mdlueck

Sr. Application Developer
Local time
Today, 02:34
Joined
Jun 23, 2011
Messages
2,649
I was thinking to use the DoCmd.NavigateTo technique to shift focus to a specific form by name, and then be able to issue to that form a DoCmd.Minimize / DoCmd.Restore.

I am not finding example code of now to DoCmd.NavigateTo to a specific form. The official help docs are rather vague and example-less.

The only thing I currently use DoCmd.NavigateTo for currently is to minimize the Navigation Pane, which that is referred to by what looks like an internal constant value... thus is a poor example of how to NavigateTo a specific Access form.
 
Thank you, vbaInet.

hhhhmmmm..... I believe my setting the subsequent windows to Modal is perhaps blocking this call....

Code:
  'Open the aoepfmea window
  flgInitArchitecture = True
  DoCmd.OpenForm strDocName

  'Now minimize this window
  DoCmd.SelectObject acForm, Me.Name, False
  DoCmd.Minimize
(tinkering with the aoepfmea form, turning off the Modal property.... Yup, that was it)

So is there a way to completely hide the fact that I leave the dashboard form open? I did not find a DoCmd.Hide lurking about. In order to be able to remove the Modal property, I need it to be as if the dashboard form is not there at all. No getting back to it to go in two diffrent paths from the dashboard at the same time. The reason I need to leave it open is that the dashboard has 5 rollups that each fire a stored procedure and each stored procedure has to run three queries in order to compute the summary. I leave that dashboard form open so that I only need to recalc the path the user went down, not all five paths.

aaaahhhh!!!! :D

On the Dashboard form...

Code:
  'Open the aoepfmea window
  flgInitArchitecture = True
  DoCmd.OpenForm strDocName

[B][COLOR=Blue]  'Now hide this window
  Me.Visible = False
[/COLOR] [/B]
On the child form of the five paths...

Code:
  'Call the AOE form event to recalc the Precent Complete for this category
  Call Forms("aoe").Requery_PFMEA

[B][COLOR=Blue]  'Unhide the aoe form as well
  Forms("aoe").Visible = True
[/COLOR][/B] 
  'Clear the mouse hourglass pointer
  Call uiutils_SetMouseDefault
  'Close window "self"
  DoCmd.Close acForm, Me.Name
THAT works... now I may disable Modal on the children forms. Thank you so much! :cool:
 
About this solid solution/trick I rediscovered... Opening Forms hidden, getting the controls configured / populated in the desired state, then unhiding the Form was one speed optimization taught to Paradox for Windows developers 20 years ago. With modern hardware, such is no longer a requirement... and I had forgotten the technique. :cool:
 
Using that technique you won't even notice the time save these days. ;)
 

Users who are viewing this thread

Back
Top Bottom