Password Protecting Cells on a Form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can I password protect certain cells on my form? There are signature blocks
and I do not want anyone but the holder of the password to be able to fill in
their name. There are 5 signature blocks and I would need 5 different
passwords. The program is password protected but I would like to go one step
further.

ANy help is greatly appreciated.

David Rowe
 
DDrowe,
Sure... I'd build a small table that holds the 5 UserIDs and Passwords.
Using the BeforeUpdate event of your 5 fields, prompt for Password with and Input
Dialog box (use = [CurrentUser] to identify who is signed on), and after the Password
Input, do a Dlookup against the Password table.
If Dlookup is Null, prevent change...
Cancel = True
Signature1.Undo
Exit Sub
If Not Null... proceed with change...
 
Can I password protect certain cells on my form? There are signature blocks
and I do not want anyone but the holder of the password to be able to fill in
their name. There are 5 signature blocks and I would need 5 different
passwords. The program is password protected but I would like to go one step
further.

ANy help is greatly appreciated.

David Rowe

At a very basic level, you can set the control's Locked property to
Yes.
Code the Double-click event of the control:

If InputBox("Enter Password") = "ThePasWOrD" Then
Me![ControlName].Locked = False
End If

Code the Exit event of the control
Me![ControlName].Locked = True

Double-clicking the control will display an InputBox for the entry of
the password. If the password is correct for that control, it will be
unlocked.

Because there is no way to use a Password input mask on an InputBox,
you might want to create an unbound form using an unbound control with
a Password Input Mask.
Name the control "txtPassword.
Add a command button to the form.
Set it's click event to
Me.Visible = False
Name this form "frmPasswords"

Then change the Control's Double-click code above to:

DoCmd.OpenForm "FormName", , , , , acDialog
If forms!frmPasswords!txtPassword = "ThePasWOrD" Then
Me![ControlName].Locked = False
End If
DoCmd.Close acForm, "frmPasswords"
 
Thanks. I'll give it a try.

Al Camp said:
DDrowe,
Sure... I'd build a small table that holds the 5 UserIDs and Passwords.
Using the BeforeUpdate event of your 5 fields, prompt for Password with and Input
Dialog box (use = [CurrentUser] to identify who is signed on), and after the Password
Input, do a Dlookup against the Password table.
If Dlookup is Null, prevent change...
Cancel = True
Signature1.Undo
Exit Sub
If Not Null... proceed with change...
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


DDrowe said:
Can I password protect certain cells on my form? There are signature blocks
and I do not want anyone but the holder of the password to be able to fill in
their name. There are 5 signature blocks and I would need 5 different
passwords. The program is password protected but I would like to go one step
further.

ANy help is greatly appreciated.

David Rowe
 
I am still new at this although I feel that I have learned a lot just from
the help I have received from this group.

Can you walk me through in a little more detail what you mean. I understand
the "BeforeUpdate" but not how to get it to prompt me for a password. Nor do
I understand where to put the Dlookup routine you wrote.

Thank you for your time and help.

Al Camp said:
DDrowe,
Sure... I'd build a small table that holds the 5 UserIDs and Passwords.
Using the BeforeUpdate event of your 5 fields, prompt for Password with and Input
Dialog box (use = [CurrentUser] to identify who is signed on), and after the Password
Input, do a Dlookup against the Password table.
If Dlookup is Null, prevent change...
Cancel = True
Signature1.Undo
Exit Sub
If Not Null... proceed with change...
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


DDrowe said:
Can I password protect certain cells on my form? There are signature blocks
and I do not want anyone but the holder of the password to be able to fill in
their name. There are 5 signature blocks and I would need 5 different
passwords. The program is password protected but I would like to go one step
further.

ANy help is greatly appreciated.

David Rowe
 
DDrowe,
Say Bob Smith (username = BSmith) opens the database, and one on ethe entries in your
Password table is...
UserName Password
BSmith XYZ

Place a hidden field on your form with a ControlSource of...
=CurrentUser
and call it CUser.

Put this code in your field BeforeUpadate event

Private Sub Signature1_BeforeUpdate(Cancel As Integer)
Dim Response As String
Response = InputBox("Enter Password", "Password Required")
If Response <> DLookup("[Password]", "tblSignaturePasswords", "UserName =
Forms!YourFormName!CUser") Then
Beep
MsgBox "Incorrect Password.", vbOKOnly, "Entry Denied"
Cancel = True
Signature1.Undo
End If
End Sub

I tested, and this worked OK...
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


DDrowe said:
I am still new at this although I feel that I have learned a lot just from
the help I have received from this group.

Can you walk me through in a little more detail what you mean. I understand
the "BeforeUpdate" but not how to get it to prompt me for a password. Nor do
I understand where to put the Dlookup routine you wrote.

Thank you for your time and help.

Al Camp said:
DDrowe,
Sure... I'd build a small table that holds the 5 UserIDs and Passwords.
Using the BeforeUpdate event of your 5 fields, prompt for Password with and Input
Dialog box (use = [CurrentUser] to identify who is signed on), and after the Password
Input, do a Dlookup against the Password table.
If Dlookup is Null, prevent change...
Cancel = True
Signature1.Undo
Exit Sub
If Not Null... proceed with change...
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


DDrowe said:
Can I password protect certain cells on my form? There are signature blocks
and I do not want anyone but the holder of the password to be able to fill in
their name. There are 5 signature blocks and I would need 5 different
passwords. The program is password protected but I would like to go one step
further.

ANy help is greatly appreciated.

David Rowe
 
THanks for the help. I'll give this a try. This Discussion group has been
great.

Thanks again.

David

Al Camp said:
DDrowe,
Say Bob Smith (username = BSmith) opens the database, and one on ethe entries in your
Password table is...
UserName Password
BSmith XYZ

Place a hidden field on your form with a ControlSource of...
=CurrentUser
and call it CUser.

Put this code in your field BeforeUpadate event

Private Sub Signature1_BeforeUpdate(Cancel As Integer)
Dim Response As String
Response = InputBox("Enter Password", "Password Required")
If Response <> DLookup("[Password]", "tblSignaturePasswords", "UserName =
Forms!YourFormName!CUser") Then
Beep
MsgBox "Incorrect Password.", vbOKOnly, "Entry Denied"
Cancel = True
Signature1.Undo
End If
End Sub

I tested, and this worked OK...
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


DDrowe said:
I am still new at this although I feel that I have learned a lot just from
the help I have received from this group.

Can you walk me through in a little more detail what you mean. I understand
the "BeforeUpdate" but not how to get it to prompt me for a password. Nor do
I understand where to put the Dlookup routine you wrote.

Thank you for your time and help.

Al Camp said:
DDrowe,
Sure... I'd build a small table that holds the 5 UserIDs and Passwords.
Using the BeforeUpdate event of your 5 fields, prompt for Password with and Input
Dialog box (use = [CurrentUser] to identify who is signed on), and after the Password
Input, do a Dlookup against the Password table.
If Dlookup is Null, prevent change...
Cancel = True
Signature1.Undo
Exit Sub
If Not Null... proceed with change...
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


Can I password protect certain cells on my form? There are signature blocks
and I do not want anyone but the holder of the password to be able to fill in
their name. There are 5 signature blocks and I would need 5 different
passwords. The program is password protected but I would like to go one step
further.

ANy help is greatly appreciated.

David Rowe
 
DDrowe,
I'll monitor this post for another week or so... to see how you make out...
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

DDrowe said:
THanks for the help. I'll give this a try. This Discussion group has been
great.

Thanks again.

David

Al Camp said:
DDrowe,
Say Bob Smith (username = BSmith) opens the database, and one on ethe entries in
your
Password table is...
UserName Password
BSmith XYZ

Place a hidden field on your form with a ControlSource of...
=CurrentUser
and call it CUser.

Put this code in your field BeforeUpadate event

Private Sub Signature1_BeforeUpdate(Cancel As Integer)
Dim Response As String
Response = InputBox("Enter Password", "Password Required")
If Response <> DLookup("[Password]", "tblSignaturePasswords", "UserName =
Forms!YourFormName!CUser") Then
Beep
MsgBox "Incorrect Password.", vbOKOnly, "Entry Denied"
Cancel = True
Signature1.Undo
End If
End Sub

I tested, and this worked OK...
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


DDrowe said:
I am still new at this although I feel that I have learned a lot just from
the help I have received from this group.

Can you walk me through in a little more detail what you mean. I understand
the "BeforeUpdate" but not how to get it to prompt me for a password. Nor do
I understand where to put the Dlookup routine you wrote.

Thank you for your time and help.

:

DDrowe,
Sure... I'd build a small table that holds the 5 UserIDs and Passwords.
Using the BeforeUpdate event of your 5 fields, prompt for Password with and Input
Dialog box (use = [CurrentUser] to identify who is signed on), and after the
Password
Input, do a Dlookup against the Password table.
If Dlookup is Null, prevent change...
Cancel = True
Signature1.Undo
Exit Sub
If Not Null... proceed with change...
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


Can I password protect certain cells on my form? There are signature blocks
and I do not want anyone but the holder of the password to be able to fill in
their name. There are 5 signature blocks and I would need 5 different
passwords. The program is password protected but I would like to go one step
further.

ANy help is greatly appreciated.

David Rowe
 
Yes it works. Here is the problem. If I make one table then whoever is
signed in can fill in the signature section for any of the slots. I then
tried to create a table for each of the signers and give them password access
to their signature spot only. This does not work. If they make a change it
asks for a password. It works for anything you give it then - the proper
password or anything else you want to type in. Am I asking too much. THe
one table is a lot better than it was and I will deffinately use it but I was
shooting for the person to be able to put their signature in their box only.

Thanks for all the help.

David
Al Camp said:
DDrowe,
I'll monitor this post for another week or so... to see how you make out...
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

DDrowe said:
THanks for the help. I'll give this a try. This Discussion group has been
great.

Thanks again.

David

Al Camp said:
DDrowe,
Say Bob Smith (username = BSmith) opens the database, and one on ethe entries in
your
Password table is...
UserName Password
BSmith XYZ

Place a hidden field on your form with a ControlSource of...
=CurrentUser
and call it CUser.

Put this code in your field BeforeUpadate event

Private Sub Signature1_BeforeUpdate(Cancel As Integer)
Dim Response As String
Response = InputBox("Enter Password", "Password Required")
If Response <> DLookup("[Password]", "tblSignaturePasswords", "UserName =
Forms!YourFormName!CUser") Then
Beep
MsgBox "Incorrect Password.", vbOKOnly, "Entry Denied"
Cancel = True
Signature1.Undo
End If
End Sub

I tested, and this worked OK...
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


I am still new at this although I feel that I have learned a lot just from
the help I have received from this group.

Can you walk me through in a little more detail what you mean. I understand
the "BeforeUpdate" but not how to get it to prompt me for a password. Nor do
I understand where to put the Dlookup routine you wrote.

Thank you for your time and help.

:

DDrowe,
Sure... I'd build a small table that holds the 5 UserIDs and Passwords.
Using the BeforeUpdate event of your 5 fields, prompt for Password with and Input
Dialog box (use = [CurrentUser] to identify who is signed on), and after the
Password
Input, do a Dlookup against the Password table.
If Dlookup is Null, prevent change...
Cancel = True
Signature1.Undo
Exit Sub
If Not Null... proceed with change...
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


Can I password protect certain cells on my form? There are signature blocks
and I do not want anyone but the holder of the password to be able to fill in
their name. There are 5 signature blocks and I would need 5 different
passwords. The program is password protected but I would like to go one step
further.

ANy help is greatly appreciated.

David Rowe
 
Can I do something like - A person signs in to get into the program. The
form has the user id. If they click on the wrong signature - a block pops up
and says that they do not have access to that block .

Just a thought.

Thanks

David

Al Camp said:
DDrowe,
I'll monitor this post for another week or so... to see how you make out...
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

DDrowe said:
THanks for the help. I'll give this a try. This Discussion group has been
great.

Thanks again.

David

Al Camp said:
DDrowe,
Say Bob Smith (username = BSmith) opens the database, and one on ethe entries in
your
Password table is...
UserName Password
BSmith XYZ

Place a hidden field on your form with a ControlSource of...
=CurrentUser
and call it CUser.

Put this code in your field BeforeUpadate event

Private Sub Signature1_BeforeUpdate(Cancel As Integer)
Dim Response As String
Response = InputBox("Enter Password", "Password Required")
If Response <> DLookup("[Password]", "tblSignaturePasswords", "UserName =
Forms!YourFormName!CUser") Then
Beep
MsgBox "Incorrect Password.", vbOKOnly, "Entry Denied"
Cancel = True
Signature1.Undo
End If
End Sub

I tested, and this worked OK...
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


I am still new at this although I feel that I have learned a lot just from
the help I have received from this group.

Can you walk me through in a little more detail what you mean. I understand
the "BeforeUpdate" but not how to get it to prompt me for a password. Nor do
I understand where to put the Dlookup routine you wrote.

Thank you for your time and help.

:

DDrowe,
Sure... I'd build a small table that holds the 5 UserIDs and Passwords.
Using the BeforeUpdate event of your 5 fields, prompt for Password with and Input
Dialog box (use = [CurrentUser] to identify who is signed on), and after the
Password
Input, do a Dlookup against the Password table.
If Dlookup is Null, prevent change...
Cancel = True
Signature1.Undo
Exit Sub
If Not Null... proceed with change...
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


Can I password protect certain cells on my form? There are signature blocks
and I do not want anyone but the holder of the password to be able to fill in
their name. There are 5 signature blocks and I would need 5 different
passwords. The program is password protected but I would like to go one step
further.

ANy help is greatly appreciated.

David Rowe
 
DDrowe,
I built a table with this...
"Admin" "XYZ"
I tested my code, and... as "admin" UserName, I could not change the Signature field
unless I eneterd the password "XYZ". So, I don't know why that didn't work for you.
I would need to know how you set up yout Password table(fields, types), some sample
entries in that table, and your form code.

You could use the OnCurrent event to Enable or Disable those fields that the UserID
doesn't have access to... or hide/show them accordingly.
But, that would require changing the form code every time a UserID changes.
Using a table makes one location to update, that can apply to all forms that you
"might" have that are similar to this one.
Your call...

I would not use separate tables for each password.

--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


DDrowe said:
Can I do something like - A person signs in to get into the program. The
form has the user id. If they click on the wrong signature - a block pops up
and says that they do not have access to that block .

Just a thought.

Thanks

David

Al Camp said:
DDrowe,
I'll monitor this post for another week or so... to see how you make out...
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

DDrowe said:
THanks for the help. I'll give this a try. This Discussion group has been
great.

Thanks again.

David

:

DDrowe,
Say Bob Smith (username = BSmith) opens the database, and one on ethe entries in
your
Password table is...
UserName Password
BSmith XYZ

Place a hidden field on your form with a ControlSource of...
=CurrentUser
and call it CUser.

Put this code in your field BeforeUpadate event

Private Sub Signature1_BeforeUpdate(Cancel As Integer)
Dim Response As String
Response = InputBox("Enter Password", "Password Required")
If Response <> DLookup("[Password]", "tblSignaturePasswords", "UserName =
Forms!YourFormName!CUser") Then
Beep
MsgBox "Incorrect Password.", vbOKOnly, "Entry Denied"
Cancel = True
Signature1.Undo
End If
End Sub

I tested, and this worked OK...
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


I am still new at this although I feel that I have learned a lot just from
the help I have received from this group.

Can you walk me through in a little more detail what you mean. I understand
the "BeforeUpdate" but not how to get it to prompt me for a password. Nor do
I understand where to put the Dlookup routine you wrote.

Thank you for your time and help.

:

DDrowe,
Sure... I'd build a small table that holds the 5 UserIDs and Passwords.
Using the BeforeUpdate event of your 5 fields, prompt for Password with and
Input
Dialog box (use = [CurrentUser] to identify who is signed on), and after the
Password
Input, do a Dlookup against the Password table.
If Dlookup is Null, prevent change...
Cancel = True
Signature1.Undo
Exit Sub
If Not Null... proceed with change...
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


Can I password protect certain cells on my form? There are signature blocks
and I do not want anyone but the holder of the password to be able to fill in
their name. There are 5 signature blocks and I would need 5 different
passwords. The program is password protected but I would like to go one step
further.

ANy help is greatly appreciated.

David Rowe
 
Can I nest an If.. Then so that If the Cuser = drowe then it goes to your If
Then staement and if not it tells the user to try again.

I'll send you a copy of what I have written and see if you can see where its
mucked up.

Al Camp said:
DDrowe,
I built a table with this...
"Admin" "XYZ"
I tested my code, and... as "admin" UserName, I could not change the Signature field
unless I eneterd the password "XYZ". So, I don't know why that didn't work for you.
I would need to know how you set up yout Password table(fields, types), some sample
entries in that table, and your form code.

You could use the OnCurrent event to Enable or Disable those fields that the UserID
doesn't have access to... or hide/show them accordingly.
But, that would require changing the form code every time a UserID changes.
Using a table makes one location to update, that can apply to all forms that you
"might" have that are similar to this one.
Your call...

I would not use separate tables for each password.

--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


DDrowe said:
Can I do something like - A person signs in to get into the program. The
form has the user id. If they click on the wrong signature - a block pops up
and says that they do not have access to that block .

Just a thought.

Thanks

David

Al Camp said:
DDrowe,
I'll monitor this post for another week or so... to see how you make out...
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

THanks for the help. I'll give this a try. This Discussion group has been
great.

Thanks again.

David

:

DDrowe,
Say Bob Smith (username = BSmith) opens the database, and one on ethe entries in
your
Password table is...
UserName Password
BSmith XYZ

Place a hidden field on your form with a ControlSource of...
=CurrentUser
and call it CUser.

Put this code in your field BeforeUpadate event

Private Sub Signature1_BeforeUpdate(Cancel As Integer)
Dim Response As String
Response = InputBox("Enter Password", "Password Required")
If Response <> DLookup("[Password]", "tblSignaturePasswords", "UserName =
Forms!YourFormName!CUser") Then
Beep
MsgBox "Incorrect Password.", vbOKOnly, "Entry Denied"
Cancel = True
Signature1.Undo
End If
End Sub

I tested, and this worked OK...
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


I am still new at this although I feel that I have learned a lot just from
the help I have received from this group.

Can you walk me through in a little more detail what you mean. I understand
the "BeforeUpdate" but not how to get it to prompt me for a password. Nor do
I understand where to put the Dlookup routine you wrote.

Thank you for your time and help.

:

DDrowe,
Sure... I'd build a small table that holds the 5 UserIDs and Passwords.
Using the BeforeUpdate event of your 5 fields, prompt for Password with and
Input
Dialog box (use = [CurrentUser] to identify who is signed on), and after the
Password
Input, do a Dlookup against the Password table.
If Dlookup is Null, prevent change...
Cancel = True
Signature1.Undo
Exit Sub
If Not Null... proceed with change...
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


Can I password protect certain cells on my form? There are signature blocks
and I do not want anyone but the holder of the password to be able to fill in
their name. There are 5 signature blocks and I would need 5 different
passwords. The program is password protected but I would like to go one step
further.

ANy help is greatly appreciated.

David Rowe
 
UserName Password
Drowe dylanlexi
Jcefola jcefola
Jcraig jcraig
Mlambert mlambert
Bdraeger bdraeger
Pwick pwick
Chris Kunz ckunz
Lcarrick lcarrick This table is called "tbSignaturePassword" Both columns
are Text with a field size of 50.

This is the routine for signatures. My problem is that using this like:

Private Sub Signature_BeforeUpdate(Cancel As Integer)
Dim Response As String
Response = InputBox("Enter Password", "Password Required")
If Response <> DLookup("[Password]", "tblSignaturePasswords",
"UserName=Forms!EHSRTrial!Cuser") Then
Beep
MsgBox "Incorrect Password.", vbOKOnly, "Entry Denied"
Cancel = True
Signature.Undo
End If
End Sub

DOing this works for each / every signature hole. My goal was to get only
one signature block available to be modified based on who was signed in.
That way there would be no question that someone had tampered with the other
signatures.


Al Camp said:
DDrowe,
I built a table with this...
"Admin" "XYZ"
I tested my code, and... as "admin" UserName, I could not change the Signature field
unless I eneterd the password "XYZ". So, I don't know why that didn't work for you.
I would need to know how you set up yout Password table(fields, types), some sample
entries in that table, and your form code.

You could use the OnCurrent event to Enable or Disable those fields that the UserID
doesn't have access to... or hide/show them accordingly.
But, that would require changing the form code every time a UserID changes.
Using a table makes one location to update, that can apply to all forms that you
"might" have that are similar to this one.
Your call...

I would not use separate tables for each password.

--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


DDrowe said:
Can I do something like - A person signs in to get into the program. The
form has the user id. If they click on the wrong signature - a block pops up
and says that they do not have access to that block .

Just a thought.

Thanks

David

Al Camp said:
DDrowe,
I'll monitor this post for another week or so... to see how you make out...
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

THanks for the help. I'll give this a try. This Discussion group has been
great.

Thanks again.

David

:

DDrowe,
Say Bob Smith (username = BSmith) opens the database, and one on ethe entries in
your
Password table is...
UserName Password
BSmith XYZ

Place a hidden field on your form with a ControlSource of...
=CurrentUser
and call it CUser.

Put this code in your field BeforeUpadate event

Private Sub Signature1_BeforeUpdate(Cancel As Integer)
Dim Response As String
Response = InputBox("Enter Password", "Password Required")
If Response <> DLookup("[Password]", "tblSignaturePasswords", "UserName =
Forms!YourFormName!CUser") Then
Beep
MsgBox "Incorrect Password.", vbOKOnly, "Entry Denied"
Cancel = True
Signature1.Undo
End If
End Sub

I tested, and this worked OK...
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


I am still new at this although I feel that I have learned a lot just from
the help I have received from this group.

Can you walk me through in a little more detail what you mean. I understand
the "BeforeUpdate" but not how to get it to prompt me for a password. Nor do
I understand where to put the Dlookup routine you wrote.

Thank you for your time and help.

:

DDrowe,
Sure... I'd build a small table that holds the 5 UserIDs and Passwords.
Using the BeforeUpdate event of your 5 fields, prompt for Password with and
Input
Dialog box (use = [CurrentUser] to identify who is signed on), and after the
Password
Input, do a Dlookup against the Password table.
If Dlookup is Null, prevent change...
Cancel = True
Signature1.Undo
Exit Sub
If Not Null... proceed with change...
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


Can I password protect certain cells on my form? There are signature blocks
and I do not want anyone but the holder of the password to be able to fill in
their name. There are 5 signature blocks and I would need 5 different
passwords. The program is password protected but I would like to go one step
further.

ANy help is greatly appreciated.

David Rowe
 
In another post, I wrote...
You could use the OnCurrent event to Enable or Disable those fields that the UserID
doesn't have access to... or hide/show them accordingly.
But, that would require changing the form code every time a UserID changes.
Using a table makes one location to update, that can apply to all forms that you
"might" have that are similar to this one.
Your call...

Private Sub Form_Current()
If CUser = "Drowe" Then
Sign1.Visible = True (can sign1)
Sign2.Visible = False
'(... etc for all 5)
ElseIf CUser = "Jcefola" Then
Sign1.Visible = False
Sign2.Visible = True (can sign2)
Sign3.Visible = False
'(... etc for all 5)
ElseIf CUser =
'etc...

End If
End Sub

This is just the "basic" method... it can be automated more, but for now just try
this.
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


DDrowe said:
UserName Password
Drowe dylanlexi
Jcefola jcefola
Jcraig jcraig
Mlambert mlambert
Bdraeger bdraeger
Pwick pwick
Chris Kunz ckunz
Lcarrick lcarrick This table is called "tbSignaturePassword" Both columns
are Text with a field size of 50.

This is the routine for signatures. My problem is that using this like:

Private Sub Signature_BeforeUpdate(Cancel As Integer)
Dim Response As String
Response = InputBox("Enter Password", "Password Required")
If Response <> DLookup("[Password]", "tblSignaturePasswords",
"UserName=Forms!EHSRTrial!Cuser") Then
Beep
MsgBox "Incorrect Password.", vbOKOnly, "Entry Denied"
Cancel = True
Signature.Undo
End If
End Sub

DOing this works for each / every signature hole. My goal was to get only
one signature block available to be modified based on who was signed in.
That way there would be no question that someone had tampered with the other
signatures.


Al Camp said:
DDrowe,
I built a table with this...
"Admin" "XYZ"
I tested my code, and... as "admin" UserName, I could not change the Signature
field
unless I eneterd the password "XYZ". So, I don't know why that didn't work for you.
I would need to know how you set up yout Password table(fields, types), some sample
entries in that table, and your form code.

You could use the OnCurrent event to Enable or Disable those fields that the UserID
doesn't have access to... or hide/show them accordingly.
But, that would require changing the form code every time a UserID changes.
Using a table makes one location to update, that can apply to all forms that you
"might" have that are similar to this one.
Your call...

I would not use separate tables for each password.

--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


DDrowe said:
Can I do something like - A person signs in to get into the program. The
form has the user id. If they click on the wrong signature - a block pops up
and says that they do not have access to that block .

Just a thought.

Thanks

David

:

DDrowe,
I'll monitor this post for another week or so... to see how you make out...
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

THanks for the help. I'll give this a try. This Discussion group has been
great.

Thanks again.

David

:

DDrowe,
Say Bob Smith (username = BSmith) opens the database, and one on ethe entries
in
your
Password table is...
UserName Password
BSmith XYZ

Place a hidden field on your form with a ControlSource of...
=CurrentUser
and call it CUser.

Put this code in your field BeforeUpadate event

Private Sub Signature1_BeforeUpdate(Cancel As Integer)
Dim Response As String
Response = InputBox("Enter Password", "Password Required")
If Response <> DLookup("[Password]", "tblSignaturePasswords", "UserName =
Forms!YourFormName!CUser") Then
Beep
MsgBox "Incorrect Password.", vbOKOnly, "Entry Denied"
Cancel = True
Signature1.Undo
End If
End Sub

I tested, and this worked OK...
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


I am still new at this although I feel that I have learned a lot just from
the help I have received from this group.

Can you walk me through in a little more detail what you mean. I understand
the "BeforeUpdate" but not how to get it to prompt me for a password. Nor do
I understand where to put the Dlookup routine you wrote.

Thank you for your time and help.

:

DDrowe,
Sure... I'd build a small table that holds the 5 UserIDs and Passwords.
Using the BeforeUpdate event of your 5 fields, prompt for Password with and
Input
Dialog box (use = [CurrentUser] to identify who is signed on), and after the
Password
Input, do a Dlookup against the Password table.
If Dlookup is Null, prevent change...
Cancel = True
Signature1.Undo
Exit Sub
If Not Null... proceed with change...
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


Can I password protect certain cells on my form? There are signature blocks
and I do not want anyone but the holder of the password to be able to fill
in
their name. There are 5 signature blocks and I would need 5 different
passwords. The program is password protected but I would like to go one
step
further.

ANy help is greatly appreciated.

David Rowe
 
I have put that in and so far it appears that it will work great. Thanks for
all the help and especially the patience.

David

Al Camp said:
In another post, I wrote...
You could use the OnCurrent event to Enable or Disable those fields that the UserID
doesn't have access to... or hide/show them accordingly.
But, that would require changing the form code every time a UserID changes.
Using a table makes one location to update, that can apply to all forms that you
"might" have that are similar to this one.
Your call...

Private Sub Form_Current()
If CUser = "Drowe" Then
Sign1.Visible = True (can sign1)
Sign2.Visible = False
'(... etc for all 5)
ElseIf CUser = "Jcefola" Then
Sign1.Visible = False
Sign2.Visible = True (can sign2)
Sign3.Visible = False
'(... etc for all 5)
ElseIf CUser =
'etc...

End If
End Sub

This is just the "basic" method... it can be automated more, but for now just try
this.
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


DDrowe said:
UserName Password
Drowe dylanlexi
Jcefola jcefola
Jcraig jcraig
Mlambert mlambert
Bdraeger bdraeger
Pwick pwick
Chris Kunz ckunz
Lcarrick lcarrick This table is called "tbSignaturePassword" Both columns
are Text with a field size of 50.

This is the routine for signatures. My problem is that using this like:

Private Sub Signature_BeforeUpdate(Cancel As Integer)
Dim Response As String
Response = InputBox("Enter Password", "Password Required")
If Response <> DLookup("[Password]", "tblSignaturePasswords",
"UserName=Forms!EHSRTrial!Cuser") Then
Beep
MsgBox "Incorrect Password.", vbOKOnly, "Entry Denied"
Cancel = True
Signature.Undo
End If
End Sub

DOing this works for each / every signature hole. My goal was to get only
one signature block available to be modified based on who was signed in.
That way there would be no question that someone had tampered with the other
signatures.


Al Camp said:
DDrowe,
I built a table with this...
"Admin" "XYZ"
I tested my code, and... as "admin" UserName, I could not change the Signature
field
unless I eneterd the password "XYZ". So, I don't know why that didn't work for you.
I would need to know how you set up yout Password table(fields, types), some sample
entries in that table, and your form code.

You could use the OnCurrent event to Enable or Disable those fields that the UserID
doesn't have access to... or hide/show them accordingly.
But, that would require changing the form code every time a UserID changes.
Using a table makes one location to update, that can apply to all forms that you
"might" have that are similar to this one.
Your call...

I would not use separate tables for each password.

--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


Can I do something like - A person signs in to get into the program. The
form has the user id. If they click on the wrong signature - a block pops up
and says that they do not have access to that block .

Just a thought.

Thanks

David

:

DDrowe,
I'll monitor this post for another week or so... to see how you make out...
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

THanks for the help. I'll give this a try. This Discussion group has been
great.

Thanks again.

David

:

DDrowe,
Say Bob Smith (username = BSmith) opens the database, and one on ethe entries
in
your
Password table is...
UserName Password
BSmith XYZ

Place a hidden field on your form with a ControlSource of...
=CurrentUser
and call it CUser.

Put this code in your field BeforeUpadate event

Private Sub Signature1_BeforeUpdate(Cancel As Integer)
Dim Response As String
Response = InputBox("Enter Password", "Password Required")
If Response <> DLookup("[Password]", "tblSignaturePasswords", "UserName =
Forms!YourFormName!CUser") Then
Beep
MsgBox "Incorrect Password.", vbOKOnly, "Entry Denied"
Cancel = True
Signature1.Undo
End If
End Sub

I tested, and this worked OK...
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


I am still new at this although I feel that I have learned a lot just from
the help I have received from this group.

Can you walk me through in a little more detail what you mean. I understand
the "BeforeUpdate" but not how to get it to prompt me for a password. Nor do
I understand where to put the Dlookup routine you wrote.

Thank you for your time and help.

:

DDrowe,
Sure... I'd build a small table that holds the 5 UserIDs and Passwords.
Using the BeforeUpdate event of your 5 fields, prompt for Password with and
Input
Dialog box (use = [CurrentUser] to identify who is signed on), and after the
Password
Input, do a Dlookup against the Password table.
If Dlookup is Null, prevent change...
Cancel = True
Signature1.Undo
Exit Sub
If Not Null... proceed with change...
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


Can I password protect certain cells on my form? There are signature blocks
and I do not want anyone but the holder of the password to be able to fill
in
their name. There are 5 signature blocks and I would need 5 different
passwords. The program is password protected but I would like to go one
step
further.

ANy help is greatly appreciated.

David Rowe
 

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

Back
Top