View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ken Ken is offline
external usenet poster
 
Posts: 590
Default User Defined Password

OK. I am sure somewhere the answer to this question is on this site, but I
can't find it anywhere.
What I am trying to do is this: When the user opens the file and presses
the Log In button. I want the UserForm to check and see if there is a passord
connected to the current file when the Form Initializes. If there is at least
one password stored in the selected ranges I want Label4 to read "Pease Log
In". If there is not, then I want Image1 to show a message telling the User
that he/she "Needs to set up a user account".
I have the Image1 ready to go and all othere labels are set. My question:
is there a way to check for a predefined password set by the user in a
previous session?

So far what I have is:

Private Sub ContactForm1_Initialize()
If PassCount1 = 8 Then 'Password has 8 to 25
characters
Label4.Visible = True
Label4.Caption = "Please Log In"
Image7.Visible = False
End If
If PassCount1 =0 Then
Image7.Visible = True
Label4.Visible = False
End If
End Sub

I can get one or the other part of this function to work or it runs both.
What am I doing wrong in this function in order for it to read both function
independently?

Thanks in Advance to anyone who will help me out with this lengthy problem..