UtterAccess.com
Thank you for your support!      
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Password Protect a Form    
 
   
mroberts653
post Jul 31 2007, 11:18 PM
Post #1

UtterAccess Addict
Posts: 120
From: Seven Mile, OH



I have created a type of switchboard with command buttoms to open selected forms. I would like for the user to be required to enter a password to open the form "Employee Manager". What do I need to do?
Go to the top of the page
 
+
jurotek
post Aug 1 2007, 02:25 AM
Post #2

UtterAccess VIP
Posts: 1,420
From: NV



Is your app. split and your FE in MDE?
Go to the top of the page
 
+
dannyseager
post Aug 1 2007, 02:52 AM
Post #3

UtterAccess VIP
Posts: 12,966
From: Leicester, UK



In the forms Form_Open event try adding

CODE
If inputbox("Please Enter your password")<>"[color="red"]YourPassword[/color]" then

    cancel=true

else

end if


This is obvously a very simple password system with a hard coded password but it can easily be adapted to make it more powerful
Go to the top of the page
 
+
pcarl
post Aug 27 2007, 09:40 AM
Post #4

UtterAccess Addict
Posts: 57



Danny -

Pardon my ignorance, but I need some assistance. (I'm still getting a feel for Access, and have not taken a VBA Class yet.)

Like mroberts, I would like to assign a simple level of password protection to open a form.

What I have is a form (form A) with a command button that opens another form (form B). The On-Click option for the button on Form A is set to open Form B. I would like to assign the password to Form B.

I have accessed the properties of Form B and have used the "Code Builder" option to create a new procedure and have simply pasted the code you listed into the area. My code now looks like this:


Private Sub Form_Open(Cancel As Integer)

If InputBox("Please Enter Your Password") <> "CSRUSER" Then
Cancel = True
Else
End If

End Sub

The On_Open property of Form B now reads [event procedure], but when I open the form I'm not being prompted for a password.

I know this has something to do with how I'm calling that procedure, but I don't know how to proceed. I have this probelm a lot, which is why I am anxious for my VBA class to start in a couple of weeks.

Care to lend a hand to a newbie?

~Pam
Go to the top of the page
 
+
pcarl
post Aug 27 2007, 10:05 AM
Post #5

UtterAccess Addict
Posts: 57



Danny -

Odd ... it seems to be working now. I closed MS Access and restarted it, and now it's working. Which is awesome!

~Pam
Go to the top of the page
 
+
emma81399
post Apr 2 2008, 10:06 AM
Post #6

UtterAccess Member
Posts: 9



Oh I'm so glad I found this thread it was just what I needed (IMG:http://www.utteraccess.com/forum/style_emoticons/default/sad.gif)

I do have on question though....How do I make the password show up as "*****" instead of showing the actual password that I am typing in?

I used the code that Danny posted.

TIA
Go to the top of the page
 
+

Reply to this topicStart new topic

 



RSS Go to Top  ·  Lo-Fi Version Time is now: 4th February 2012 - 08:56 PM