A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Password Request



 
 
Thread Tools Display Modes
  #1  
Old November 1st, 2008, 06:50 AM posted to microsoft.public.access.forms
Billy
external usenet poster
 
Posts: 43
Default Password Request

Im doing a Database, and I created command buttons to open a form, I dont
know if there is a possibilitie to do the following:
When someone click on one of the command button that request a password to
get into the form to add or edit or delete a registry. Is this possible?
Thank You So Much
  #2  
Old November 1st, 2008, 10:35 AM posted to microsoft.public.access.forms
Rick Brandt
external usenet poster
 
Posts: 4,354
Default Password Request

Billy wrote:
Im doing a Database, and I created command buttons to open a form, I
dont know if there is a possibilitie to do the following:
When someone click on one of the command button that request a
password to get into the form to add or edit or delete a registry. Is
this possible? Thank You So Much


Rather than putting the password prompt in the button's code, put it into
the Open event of the form. Then it will occur no matter how the form is
opened. Plus, you can open the form from multiple places and don't have to
re-write the password code every time.

In the Open event...

If InputBox("Please Enter Password") "YourPassword" Then
MsgBox "Password Incorrect"
Cancel = True
End If

Now, this is rather crude. The password is not masked with asterisks while
being entered. In addition you have to give your users an MDE file or else
they would be free to look at the code and see what the password is. It's
not what I would call "security", but in many cases it accomplishes what you
want.

Another way to go would be to hide everything on the form except for a
TextBox in the middle labeled "Password". In its AfterUpdate you run
similar code except for the Cancel = True part. This allows you to use an
InputMask of "Password" so that the user does see asterisks as he types and
it allows the user to try as many times as he wants rather than immediately
closing the form when the password is wrong. When they get it right, you
hide the password TextBox and display everything else.

If in your case you don't care about viewing, but only editing, you toggle
the AllowAdditions, AllowEdits, and AllowDeletions properties of the form
when the password is entered instead of toggling visibility.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:09 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.