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

How to lock/disable an onscreen form

Status
Not open for further replies.

jimbo1999

Programmer
Mar 11, 2003
11
GB
I'm just trying to figure out how to disable a form when another is opened on top of it.
At first I figured that I could use the form.enabled property but this doesn't appear to even exist.
Making the form invisible is not really a viable option as users will require to look at the data on the inactive form, but not be able to change it until the "on-top" form is closed.

Any help would be appreciated,
Jimbo.
 
Not exactly sure what you are trying to accompolish, but one approach would be when going from Form A to Form B via a button, in the On Click event of the button, close Form A before you open Form B. You could use code something like the following:

DoCmd.Close acForm, "FormA",acSaveNo
DoCmd.OpenForm, "FormB, acNorman

Note: acSaveNo has 3 options
1. acSaveNo
2. acSaveYes
3. acPrompt

Unless the form needs to be open for a particular reason, I generally close the current form before opening another.

HTH

An investment in knowledge always pays the best dividends.

by Benjamin Franklin
 
Thanks for the help, although closing forms is what I was trying to avoid.

When using Visual Basic (studio) (to create programs) you have the option of setting the form property "enabled" to either enable that form, or disable (lock) it, so it cannot be changed, closed, or moved (in a similar way that a screen can be disabled when an error message appears in front of it).

Is there no way of doing this to forms in Access, or is it only possible to close them down altogether in order to prevent changes to them?

Any help appreciated, but I reckon this is one of the thing Microsoft 'forgot' about when designing Access.

Thanks,
Jimbo.
 
Won't forms![MyForm].visible = false do what you want??

rollie@bwsys.net
 
Hi Jimbo,

It seems that you want Form 1 open for the user to view while they use Form 2. They can't touch, edit or move Form 1 until they're done with Form 2.

If that's the case, then set the Modal property of Form 2 to Yes. Make sure Form 2 doesn't open over Form 1. This will force the user to finish with Form 2 while still keeping Form 1 visible.

Hope this helps!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top