Password Protected Form and Report

A

Aamer

I have 2 questions

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
 
J

Jerry Whittle

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
manually. Also the data displayed in the form and report would still be in
the tables where someone could still see it.
 
A

Aamer

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.
 
A

Aamer

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.

KenSheridan via AccessMonster.com said:
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
of PASSWORD. Add a button to the form with code in its Click event procedure:


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
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]
 
D

Douglas J. Steele

Take a look at
http://www.databasejournal.com/feat...the-InputBox-function-for-MS-Access-Forms.htm

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Aamer said:
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.

KenSheridan via AccessMonster.com said:
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
of PASSWORD. Add a button to the form with code in its Click event
procedure:


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
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
 
A

Aamer

Thank You Ken Sheridan it woked, you were a great help.

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 said:
1. Create a new unbound form.

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
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]

--



.
 
A

Aamer

Douglas J. Steele

sample database on the link
"http://www.databasejournal.com/feat...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 said:
Take a look at
http://www.databasejournal.com/feat...the-InputBox-function-for-MS-Access-Forms.htm

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Aamer said:
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.

KenSheridan via AccessMonster.com said:
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
of PASSWORD. Add a button to the form with code in its Click event
procedure:


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

.
 
D

Douglas J. Steele

Sorry, not my site. I'll send a note to the editor, but I suspect it'll be a
few days before there's any response.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Aamer said:
Douglas J. Steele

sample database on the link
"http://www.databasejournal.com/feat...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 said:
Take a look at
http://www.databasejournal.com/feat...the-InputBox-function-for-MS-Access-Forms.htm

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Aamer said:
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
of PASSWORD. Add a button to the form with code in its Click event
procedure:


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

.
 
D

Douglas J. Steele

The site has been fixed.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Douglas J. Steele said:
Sorry, not my site. I'll send a note to the editor, but I suspect it'll be
a few days before there's any response.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Aamer said:
Douglas J. Steele

sample database on the link
"http://www.databasejournal.com/feat...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 said:
Take a look at
http://www.databasejournal.com/feat...the-InputBox-function-for-MS-Access-Forms.htm

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



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
of PASSWORD. Add a button to the form with code in its Click event
procedure:


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

--


.


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top