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 Protecting a Form    
 
   
SarahBash
post Jan 28 2010, 06:36 PM
Post #1

UtterAccess Member
Posts: 19
From: Melbourne, Australia



I am currently trying to password protect a form as it contains employee records. I have the following code:

Option Compare Database
Option Explicit

Private Sub OpenEmployeeRecordsForm_Click()
Dim PassWord As String
PassWord = InputBox("Please Enter Password")
If PassWord = "Password" Then
DoCmd.OpenForm "frmEmployeeRecords"
DoCmd.GoToRecord , , acNewRec
Else
MsgBox ("You're not authorised")
End If
End Sub

At the On Click section in design view I have [event procedure]

The problem I have is that when I go to the main Switchboard and click on the button to get the password input box, nothing happens.

Anyone have any ides???
Go to the top of the page
 
+
Jack Cowley
post Jan 28 2010, 06:53 PM
Post #2

UA Editor + Utterly Certified
Posts: 37,678
From: The San Francisco Bay Area



Take a look here. Hopefully this will help...

Jack
Go to the top of the page
 
+
RuralGuy
post Jan 28 2010, 06:55 PM
Post #3

UtterAccess VIP
Posts: 2,355
From: @ 8300' in the Colorado Rocky Mountains



When you go to the Event tab of the property sheet for the button and press the "..." button, what happens?
Go to the top of the page
 
+
SarahBash
post Jan 28 2010, 07:00 PM
Post #4

UtterAccess Member
Posts: 19
From: Melbourne, Australia



It displays the Visual Basic window and the code
Go to the top of the page
 
+
RuralGuy
post Jan 28 2010, 07:10 PM
Post #5

UtterAccess VIP
Posts: 2,355
From: @ 8300' in the Colorado Rocky Mountains



Are you in a trusted location?
http://www.btabdevelopment.com/main/QuickT...57/Default.aspx
Go to the top of the page
 
+
foxtrojan
post Jan 28 2010, 08:53 PM
Post #6

UtterAccess Veteran
Posts: 432
From: Singapore



Hi Jack, Sorry to barge in. Further to the codes to open a form, what about codes to open forms that which the password is authorised to? Example, a Master password can open all forms but certain User's password can open certain forms which he/she is authorised to. Your help will be much appreciated.
Go to the top of the page
 
+
theDBguy
post Jan 28 2010, 09:07 PM
Post #7

Access Wiki and Forums Moderator
Posts: 34,345
From: SoCal, USA



Hi foxtrojan,

Take a look at this Security Demo in the Code Archive.

Hope that helps...
Go to the top of the page
 
+
SarahBash
post Jan 28 2010, 10:00 PM
Post #8

UtterAccess Member
Posts: 19
From: Melbourne, Australia



Thanks for that RuralGuy, it works a treat!!!!
Go to the top of the page
 
+
RuralGuy
post Jan 28 2010, 10:12 PM
Post #9

UtterAccess VIP
Posts: 2,355
From: @ 8300' in the Colorado Rocky Mountains



Glad I could help.
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