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