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

Show/Hide Form vs. Form Visible:True/False

Status
Not open for further replies.

NorthNone

Programmer
Jan 27, 2003
445
US
When to use Show Form and Hide Form? When should you use form visible = true and form visible = false instead?
Details: my application has one central form. Users can get to a second pop-up form by clicking on a command button. It was kind of slow opening and closing this second form over the network once the db was fully loaded with data, so I decided to load the second form when it is first requested, thereafter I hide it when the user clicks my close button and redisplay it when they asked for it again. Currently I am using visible: true/false.
Should I use Show/Hide instead? What are the arguments each way?
Thanks and a star for assistance!
JSouth
P.S. Actually I have seven of these forms users can click to get to, but it was easier to write in the singular. Anyway I don't want to preload all the subforms on startup since users may not use them all.

---------------------------------------
The customer may not always be right, but the customer is always the customer.
 
Hi!

I think the frm.Show and frm.Hide methods are used in userforms (Word/Excel) and not in Access forms. As I've understood it, the visible false/true are the Access equivalence of frm.show/frm.hide

For speed and efficiency, there are alot of interesing stuff around, here are some:

Microsoft Access Performance FAQ
Making Access Faster - 168 Tips to Speed Up Your Apps!

And this thread from here (Name AutoCorrect ++) thread702-206410.

Please don't offer stars as "payment" in your question. The stars are a way of telling the person(s) answering that their answers where helpful. Also providing means for members to see if the thread contains useful information when they search etc...

Roy-Vidar
 
There is a Hide and a Show method for forms in Access. From Access VBA Help:
Hide Method
Hides an object but doesn't unload it.
Syntax
object.Hide
The object placeholder represents an object expression that evaluates to an object in the Applies To list. If object is omitted, the UserForm with the focus is assumed to be object.
Remarks
When an object is hidden, it's removed from the screen and its Visible property is set to False. A hidden object's controls aren't accessible to the user, but they are available programmatically to the running application, to other processes that may be communicating with the application through Automation, and in Windows, to Timer control events.
When a UserForm is hidden, the user can't interact with the application until all code in the event procedure that caused the UserForm to be hidden has finished executing.
If the UserForm isn't loaded when the Hide method is invoked, the Hide method loads the UserForm but doesn't display it.


---------------------------------------
The customer may not always be right, but the customer is always the customer.
 
Hi, I reckon Hide/Show are there for compatability as VB6 and most VBA apps use this syntax for hiding showing dialog boxes; rather than visible. Access has its own version of VBA which I think used to only include visible...
 
What version are you using? Does the .Show/.Hide methods work on Access Forms too in that version?

I know they work on UserForms, as I use that in Word and Excel, but did a little test now, on my versions of Access (97 thru xp) but they didn't work there.

Roy-Vidar
 
Hi,

RoyVidar, sorry your right - I knew I'd used it recently in Access but it was controlling balloon help.

I think maybe, NorthNone, this came up in help as it applies to another library referenced in your project - if you look at the Object Browser there's no show/ hide methods for any Access objects in v2000 either...
 
Egg on my face :-(
I was certain I had used show/hide in another Access project successfully but didn't check my work before posting this question. I could have saved us all a lot of work if I had. It uses visible true/false, not show/hide.
Hats off and apologies to RoyVidar and jksmi...

---------------------------------------
The customer may not always be right, but the customer is always the customer.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top