D
Danie
How do I prevent a user from opening 2 different forms?
Thanks,
Danie
Thanks,
Danie
Danie said:How do I prevent a user from opening 2 different forms?
Thanks,
Danie
Albert D. Kallal said:I really simple and easy way is to build a nice startup form. In that form,
the users can then click on a button to launch another form.
If you open up the forms in design mode and in the "other" tab, you can set
the form to model.
This setting means that the user will have to close the form they just
opened to then choose another button/selection on your main startup form.
So, the model setting in ms-access can be used to control the user "flow"
and what forms they can or cannot open at a given point in time. So, users
will be forced to close the current form and return to where they came from
when you do this.
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
(e-mail address removed)
I did put my form on "Modal" setting but what is strange is that I can open other forms at the same time. Access should ask to close the current form before opening antother one when it is a modal form, but it's not doing so. Is there another way of preventing a 2 forms that shouldn't be opened together to be opened. My programs are called from a menu so a user can call any form from the menu and have 2 or 3 forms opened at the same time. I want to prevent that.
My programs are called from a menu so a user can call any form from the
menu and have 2 or 3 forms opened at the same time. I want to prevent
that.
My programs are called from a menu so a user can call any form from the
menu and have 2 or 3 forms opened at the same time. I want to prevent
that.
DevilDog1978 said:Danie,
I am by no means an expert, but what I did was created a couple macros. I
created one to open forms and one to close forms. From my frontpage I have
several buttons to access different forms. If you go under properities you
can have access run a macro on clicking the a button. In the macros I use
open form and close. Depending on how many forms you have it might be
cumbersome...but it works.
Klatuu said:Had you followed Albert's instructions, you wouldn't have the problem.
But, If you don't want to change your design interface, Here is a function
that will look for any open forms. It will return false if no forms are open
or true if any are open. Call it from the Open event of all you main forms
(not for subforms)
If AnyFormsOpen Then
Docmd.Quit
End If
Public Function AnyFormsOpen() As Boolean
Dim frm As Object
For Each frm In CurrentProject.AllForms
If frm.IsLoaded Then
AnyFormsOpen = True
Exit For
End If
Next
End Function
Albert D. Kallal said:Sorry, lets try this with the spell checker!!....
Dirk Goldgar said:Ah, but the spell checker won't catch the word "model" used when you meant
"modal", nor for that matter "lets" instead of "let's". <eg>
Danie said:Albert,
Excuse my ignorance but where do I put a public function?
Thanks,
Danie
test it). Once it get one menu option working, then you can change all
others.
Danie said:Albert,
Thanks for your help.
What do you mean by the paragraph below and how do I change an on-action.
Your menu buttons should work now. (just change one for the on-action and