Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Password protect specifc form 2

Status
Not open for further replies.

Computethis

IS-IT--Management
Feb 5, 2001
28
US
I need to password protect a specific form in order to keep general users from gaining access to the form. Is there a simple solution to this ????

Thanks,
Mitch
 
Are you using Access security I.E. logging in as Mitch?
If so in the on open event of your form (in Visual Basic),
something like this would work:

Private Sub Form_Open(Cancel As Integer)
On Error GoTo ErrFO
If CurrentUser()<> &quot;Mitch&quot; Then
MsgBox &quot;Permission denied.&quot;, vbCritical, &quot;Security Check.&quot;
Cancel = True
End If

ExitFO:
Exit Sub

ErrFO:
MsgBox Err.Description, vbInformation, &quot;Form Open Error.&quot;
Resume ExitFO
End Sub

Bingo! Gord
ghubbell@total.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top