Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 1st, 2005, 01:12 PM
Authorized User
 
Join Date: Dec 2004
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default lock form problem

Hi All
   I need to lock down a form, so only the manager can can edit it?
I feel so lost and don't know how can I start to program this?
   Appreciated for any suggestions!

flyfish
__________________
flyfish
 
Old March 2nd, 2005, 01:06 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Hi,

   The easiest way to do this is to split the database and make a seperate front end for managers. Lock the form in the first front end, and unlock it in the managers' front end. I do this a lot.

   Password protect the different versions of the front ends.

   You can also implement database security, but ONLY DO THIS ON A MICROSOFT NETWORK! If you try this on a network that is not capable of passing MS login credentials (like NetWare) then running the database security wizard will lock the database forever. Hehe.

   You can also do a lame kludge like this: Have two buttons to open a locked and unlocked version of the same form (for each locked field, Properties>Data>Enabled=No, Locked=Yes), and then on the manager's button, put this code:

'==========

   Dim stPassword As String
   Dim stDocName As String

   stDocName = "YourLockedFormName"

   stPassword = InputBox("Enter Password:", vbOkOnly)

   If stPassword = "yourpassword" Then
      DoCmd.OpenForm stDocName etc...
   Else:
      MsgBox "Improper Password" & vbCrLf & "Access Denied"
   End If
'==========

The minor problem with this is that the input box takes the password in plain text.

Most users will never be able to figure this one out. Although they may know <f11> and just open the form directly.

   Um, make sure to set the database window as hidden on your start up options, and name the manager's form something stupid so no one guesses at it (good if there are a lot of forms... of course, they can always open the table directly... anywho...)

HTH.


mmcdonal
 
Old March 2nd, 2005, 01:07 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

I forgot the best part... migrate to SQL, that will work wonders.

mmcdonal





Similar Threads
Thread Thread Starter Forum Replies Last Post
Lock carumuga SQL Server 2000 1 June 18th, 2008 03:07 PM
continue topic: form lock down problem flyfish Access 6 March 30th, 2005 11:31 AM
Re: forms lock down problem on Access97 flyfish Access 3 March 17th, 2005 09:09 PM
Re: forms lock down problem on Access97 flyfish Access 0 March 16th, 2005 03:34 PM
problem to "on caps lock progametically Abhinav_jain_mca General .NET 3 August 5th, 2004 03:06 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.