Protecting a particular form

Haynesey

Registered User.
Local time
Today, 06:55
Joined
Dec 19, 2001
Messages
190
Hi,

Is there any way of protecting a particular form in a database so that in can not be modified or deleted without entering a password?

Please help?

Thanks
Lee
 
You just want to secure one form??

So I'm guessing you want to give people rights to modify other objects but not this one. You'd have to setup user-level security for that.
 
The code below will force a user to enter a password to "open" a form...

This is how I use an input box to password protect a command button that opens a form...

Code:
    Dim strInput As String
    Dim strMsg As String
    
    Beep
    strMsg = "This form is used only by the ''Special Form'' people." & vbCrLf & vbLf & "Please key the ''Special Form'' password to allow access."
    strInput = InputBox(Prompt:=strMsg, title:="Special Password")
    If strInput = "SpecialFormPassword" Then 'password is correct
        DoCmd.OpenForm "YourSpecialFormNameHere"
        DoCmd.Close acForm, Me.Name
    Else 'password is incorrect
        MsgBox "Incorrect Password!" & vbCrLf & vbLf & "You are not allowed access to the ''Special Form''.", vbCritical, "Invalid Password"
        Exit Sub
    End If
You can not format an input box!

If you need the extra security of displaying ****** instead of the typed password
then you will have to create a form and format the text box as a password.

HTH
 
Thanks,

That code is great. Is there any way of just setting it up so that you only get prompted for a password if you try and go into the design view?

Thanks again for your help.
Lee
 
code:--------------------------------------------------------------------------------
Dim strInput As String
Dim strMsg As String

Beep
strMsg = "This form is used only by the ''Special Form'' people." & vbCrLf & vbLf & "Please key the ''Special Form'' password to allow access."
strInput = InputBox(Prompt:=strMsg, title:="Special Password")
If strInput = "SpecialFormPassword" Then 'password is correct
DoCmd.OpenForm "YourSpecialFormNameHere"
DoCmd.Close acForm, Me.Name
Else 'password is incorrect
MsgBox "Incorrect Password!" & vbCrLf & vbLf & "You are not allowed access to the ''Special Form''.", vbCritical, "Invalid Password"
Exit Sub
End If--------------------------------------------------------------------------------You can not format an input box!

If you need the extra security of displaying ****** instead of the typed password
then you will have to create a form and format the text box as a password.


The code didnt seem to work when i tried it, no input box appeared...do you need to create one of these? If so....how?
 
In what event (command button, on form open, etc.) are you firing my code from?
 

Users who are viewing this thread

Back
Top Bottom