Please Help...VBA Nightmare

Dawn

New member
Local time
Today, 04:23
Joined
Oct 10, 2013
Messages
2
I have been trying for over a week to get this code adjusted to the way I need it. I have done everything I can think of and know, however to my dismal all it has done is create further problems in the process that I have to then go back and fix.

The original code piece:
Private Sub CmdLogin_Click()
'/First thing needed is to decide which option to take
'/If there is an entry in the txtoldpwd field this is an existing password
'/If there is an entry in the txtconpwd field this is a new password setup
'/If there is an entry in all three then the user has reset their password

'/If password has been reset then all the validation has taken place
'/so can open the main menu straight away


If bReset = True Then
'/Create a login event for this user
'/flag that the user is currently logged in
Call CreateSession(LngUserID)
Call LogMeIn(LngUserID)
'/Open the main form and close this one
DoCmd.OpenForm "form"
DoCmd.Close acForm, "FrmLogin"
Exit Sub
End If

If I leave it like this it works fine, however I want the first form called to open to be hidden..I have tried the acNormal,,,,achidden and although it hides it fine. The login form then will not close on it's own as it should.

I also want to show a message access granted before it closes..however even when I put the msg code in it don't show and the login form still don't close on it's own. The other thing I am trying to do is get it to call up my dashboard form after the form closes. I have tried multiple ways of trying to get this accomplished.

Can anyone help, what am I doing wrong or haven't thought about? :banghead:
 
Please use code tags when posting code.

Have you tried closing your Login form before opening your hidden form?
 
I am sorry I am fairly new to this I don't know what you mean by code tags :(
and yes I did try that but it comes up with an access message error.
 
i presume you cannot hide the login form while it has the focus, and you don;t have any other open forms to set the focus to .....
 

Users who are viewing this thread

Back
Top Bottom