Splash screen

jamie_pattison

Well-known member
Joined
Sep 9, 2008
Messages
116
Programming Experience
Beginner
I'm trying to use a splash screen to check the logged on users rights and if all meets criteria it loads the default form.

Currently in my load event of the spash form i had some code along the lines

If CriteriaMet Then
OpenForm
Else
msgbox("You do not have access to this app")
End If

However the main form still loads even if the user isnt meeting the criteria. I looked at View Application Events to see if i could tie in this piece of code but i dont seem to be able to control it.

Could anyone provide some advice on what approaches i could take here?

Thanks
 
The system will show the form since it considers the form and not the splash screen to be the startup form. It doesn't depend on something to show it.
So forget about the splash screen (or if you want a splash screen, just use it as a splash screen).
Put that code in the load event for the form itself.
It will not display the form until the Load routine is completed. If the criteria are not met you display the message and call me.close.

By the way, it is preferable to use messagebox.show() rather than msgbox.
 
I am not to sure what you are trying to find out but if its if the users has admin rights then :

If My.User.IsAuthenticated Then


Else
' code here if the user is not Authenticated


End If


put the code in the form load event
 
Back
Top