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

How do I Load Forms but keep them hidden until needed

Status
Not open for further replies.

u104741

MIS
Aug 26, 2003
94
GB
In MS Access I have a fairly complex form.
This form has a tab control on it and on each tab control a seperate sub forms containing data.

The form takes a while to load each time the user needs it so i would like to have the form load when the database does and then just show it when the user needs it.

I have tried usiing a line like;
DoCmd.OpenForm "MyFormName", acNormal, , , , acHidden
but the form opens and is displayed, not hidden??

Do i have to loop through all the subforms and hide them as well or something???

Hope someone can help me...

Ta
Geoff
 
well here might be a possibility, but there might be a better way

First set echo false

DoCmd.Echo False

Then open forms while loading database

Also set the on open properties for the database and change the forms visibility to false

Dont forget to set echo to true.

this seems like a total work around, and there's most likely a better way, but this might give you some ideas anyway.

hope this helps some
eric
 
many thanks Eric I'll give that a try.
Regards
 
I'm doing exactly what you are doing and have multiple subforms also - and it works fine. Are you sure something else isn't making the form visible? Perhaps another line of code buried somewhere?
 
thanks evalesthy, i had over looked that little detail!

would making an individual control visible on a sub form have the affect of un-hidding the entire form?

(I have a routine that makes certain fields available or rather visible on a form, depending on who is logged in. This runs when the form is loaded.)

sorry if i'm asking stupid questions!
G

 
I would certainly pursue that line of thought. Comment out the suspect lines of code and see if your problem goes away. Post back and let us know.
 
yea sussed it thanks.
i found i had a 'school boy' error in my code!

i was running a sub procedure on a form when it loads.. was displaying the form after i had already tried to hide it.
thanks for setting me on the right path.
G
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top