i have the following code which works fine
Private Sub CommandButton1_Click()
Dim password As String
password = txtPasswordIn.Text
'Check to see if data is entered into field: txtPasswordIn
If IsNull(Me.txtPasswordIn) Or Me.txtPasswordIn = "" Then
MsgBox "You must enter your Password (case sensitive).", vbOKOnly, "Required Data"
Me.txtPasswordIn.SetFocus
Exit Sub
End If
'Check to see if the Password entered is valid
If password = "PASSWORD" Then
Sheets("Database").Visible = True
Sheets("Database").Activate
Unload Me
Else
'if password is wrong displays a msg and unloads the form
Sheets("Database").Visible = xlVeryHidden
MsgBox "Password Not Accepted"
Unload Me
End If
End Sub
and allows them to view the admin area of the workbook, but if they click back onto the main search page the tab is hidden again and can only be got to again by re-entering the password
can i store the password until the workbook is closed so that you only have to enter it once
cheers all
Bookmarks