1. Is it possible to put a password on a perticular form?
2. Is it also possible to put a passoword on a perticular report?
If so, then please tell me how can i do that.
I have a database in which i want a perticular form and a perticular report
password protected, that no one can access but me.
P.s I dont want to put password on the whole database.
thank you
aamer
Private Sub Command0_Click()
Dim strpassword As String
strpassword = InputBox("Password")
If strpassword = "Password" Then
DoCmd.OpenForm "Your Form"
Else: End If
DoCmd.Close acForm, "Your Form"
End Sub
But the problem is when i enter the password it shows the letters, infact it
should show ***** as I enter password.
yes i agree this is not a good solution but so far it will work, as long as
it does not show the charactors i type.
Const MESSAGETEXT = "Incorrect password."
If StrComp(Me.txtPassword, "Password", vbBinaryCompare) = 0 Then
DoCmd.OpenForm "'YourForm'"
DoCmd.Close acForm, Me.Name
Else
MsgBox MESSAGETEXT, vbExclamation, "Warning"
Me.txtPassword = Null
Me.txtPassword.SetFocus
End If
This will require a case-sensitive password to be entered. Open the dialogue
form in code whenever you want to open 'YourForm'. This is of course
extremely insecure as anyone can open YourForm directly or can open the
dialogue form's module and see the password.
Ken Sheridan
Stafford, England
Aamer wrote:
>I found one solution on this forum
>
>Private Sub Command0_Click()
>Dim strpassword As String
>strpassword = InputBox("Password")
>If strpassword = "Password" Then
>DoCmd.OpenForm "Your Form"
>Else: End If
>DoCmd.Close acForm, "Your Form"
>End Sub
>
>But the problem is when i enter the password it shows the letters, infact it
>should show ***** as I enter password.
>
>yes i agree this is not a good solution but so far it will work, as long as
>it does not show the charactors i type.
>
>> In a word: No. You might be able to cobble up something that acts like a
>> password on a from or report, but that wouldn't stop someone from opening it
>[quoted text clipped - 15 lines]
>> >
>> > aamer
--
Message posted via http://www.accessmonster.com
I would appreciate if anyone could tell me how to this step by step.
"KenSheridan via AccessMonster.com" wrote:
> .
>
2. Add a text box and name it txtPassword.
3. In the text box's properties sheet set its InputMask property to Password.
NB: it’s the word 'password' you enter here, not the text of the password
itself.
4. Add a button to the form an enter the text I posted in its Click even
procedure, changing the name of the form to that of your existing form which
you want to protect, and the password to the real password.
When you want to open the protected form open the new dialogue form instead,
and then enter the password and click the button to open the protected form.
You can provide a little more protection by amending the code in the button's
Click event procedure to:
Const MESSAGETEXT = "Incorrect password."
If StrComp(Me.txtPassword, "Password", vbBinaryCompare) = 0 Then
DoCmd.OpenForm "YourForm", OpenArgs:="Protected"
DoCmd.Close acForm, Me.Name
Else
MsgBox MESSAGETEXT, vbExclamation, "Warning"
Me.txtPassword = Null
Me.txtPassword.SetFocus
End If
Then in the protected form's Open event procedure put:
Cancel = Nz(Me.OpenArgs, "") <> "Protected"
This will prevent the form being opened directly from the database window.
Ken Sheridan
Stafford, England
Aamer wrote:
>Can you please tell me how to apply this on a form, cause everything you said
>went over my head.
>
>I would appreciate if anyone could tell me how to this step by step.
>
>> Instead of using the InputBox function, which is cheap and cheerful but very
>> limited, create a dialogue form with a text box with an input mask property
>[quoted text clipped - 41 lines]
>> >> >
>> >> > aamer
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access/200912/1
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"Aamer" <Aa...@discussions.microsoft.com> wrote in message
news:AC668A26-C50B-4C8A...@microsoft.com...
one last thing,
DoCmd.OpenForm "YourForm", OpenArgs:="Protected" do I have to type the
protected form name instead of protected or just protected?
"KenSheridan via AccessMonster.com" wrote:
> .
>
sample database on the link
"http://www.databasejournal.com/features/msaccess/article.php/3848121/Extending-the-InputBox-function-for-MS-Access-Forms.htm"
is missing. can you fix the link on your site as it would be great to see
sample aswell.
thank you
aamer
"Douglas J. Steele" wrote:
> .
>
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
"Aamer" <Aa...@discussions.microsoft.com> wrote in message
news:DC57A628-F571-4CC6...@microsoft.com...
--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_gmail.com> wrote in message
news:%23zd$I5VhKH...@TK2MSFTNGP04.phx.gbl...