My Assistant
![]() ![]() |
|
|
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??? |
|
|
|
Jan 28 2010, 06:53 PM
Post
#2
|
|
|
UA Editor + Utterly Certified Posts: 37,678 From: The San Francisco Bay Area |
|
|
|
|
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?
|
|
|
|
Jan 28 2010, 07:00 PM
Post
#4
|
|
|
UtterAccess Member Posts: 19 From: Melbourne, Australia |
It displays the Visual Basic window and the code
|
|
|
|
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 |
|
|
|
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.
|
|
|
|
Jan 28 2010, 09:07 PM
Post
#7
|
|
|
Access Wiki and Forums Moderator Posts: 34,345 From: SoCal, USA |
|
|
|
|
Jan 28 2010, 10:00 PM
Post
#8
|
|
|
UtterAccess Member Posts: 19 From: Melbourne, Australia |
Thanks for that RuralGuy, it works a treat!!!!
|
|
|
|
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 Top · Lo-Fi Version | Time is now: 4th February 2012 - 08:56 PM |