Security / IsLoaded / Access 2007

CharlesWhiteman

Registered User.
Local time
Today, 18:11
Joined
Feb 26, 2007
Messages
421
I've created a custom Home ribbon in my A2207Db and some of the ribbon commands are to allow users to open certain forms. Some of my forms reply on values in a splashscreen and that only opens after a user has logged in via a password form.

I need Access to check if a form is open and if its not then to exit the command and close. I've tried the bit of code below but when I test it I sill see a parateter value prompt referring to my splashscreen and then my form still opens although blank. Any ideas?

Code:
DoCmd.SetWarnings False
If CurrentProject.AllForms("FrmSplashScreen").IsLoaded = False Then
MsgBox "Login Required"
Exit Sub
Else
End If
DoCmd.SetWarnings True
End Sub
 
Hi Bob, Sure had tested that but no difference.
 
What event do you have this on?

Something like this in the Open Event:

Code:
If CurrentProject.AllForms("FrmSplashScreen").IsLoaded = False Then
    MsgBox "Login Required"
    DoCmd.Close acForm, Me.Name, acSaveNo
End If
End Sub

No need for the DoCmd.SetWarnings and no need for the Else and Exit Sub.
 
Or if you want the APPLICATION to close if the other form isn't loaded:

Code:
If CurrentProject.AllForms("FrmSplashScreen").IsLoaded = False Then
    MsgBox "Login Required"
    DoCmd.Quit    
End If
End Sub
 
Thanks Bob, It all seems to hinge on the fact that I cant seem to get access to halt prompting for the parameter value which at this point is held in the unloaded form. Access hated the docmd.quit even more!
 
Thanks Bob, It all seems to hinge on the fact that I cant seem to get access to halt prompting for the parameter value which at this point is held in the unloaded form. Access hated the docmd.quit even more!

What event do you have this on?
 
Its on the OnOpen but have also tried it on the OnLoad event to test trying to catch Access before it prompts for parameter
 
Its on the OnOpen but have also tried it on the OnLoad event to test trying to catch Access before it prompts for parameter

The Open event comes before the load event. So, what "parameter" are you talking about? Perhaps, if it would be quicker for you, you could upload a copy of the database and we can take a little look to see what you have and where it should go.
 
Here it is:

The event in question relates to FrmResellerSearchSales

Shitfty Key To Bypass

User test / Pw test
 

Attachments

Last edited:

Users who are viewing this thread

Back
Top Bottom