User-level security using a module

hollering

Registered User.
Local time
Today, 06:08
Joined
Feb 15, 2005
Messages
38
I have a module that authenticates users and controls who has full or read-only access to certain forms. My problem is this; things such as combo boxes and checkboxes that are meant to be used for any user are disabled in read-only mode.

I was thinking that I could use the tag property on my controls to establish which controls should always be enabled and then using my module to dynamically enable/disable the appropriate controls each time I load a form. Can anyone help me do this?

Basically all I really need to know is how to address the form in a module (since I can't use "Me.Controlname" and I don't know which form is being worked on until runtime. And also I don't want to lock records, since this won't allow other users to view the tables being used.

Also I don't want to use the Enable property because I don't want the data to be "greyed out". I could use the Locked property, but that poses the problem of multiple users trying to access the same table. So is there a way I can set certain fields to read-only without making the whole form read-only or locking the data?

By the way, I am working in Access 97

Here's a pseudo-code example of what I want

for each Cntrl in PassedForm.Controls
if Cntrl.Tag <> "AlwaysEnable" then
Disable Cntrl
end if
next
 
Last edited:
Solution

Looks like I managed to answer my own question. For future reference, this is how I did it.

On my read-only form (which uses the AllowEdits property to disable user input) I simply built an event on whatever field I wanted to work with.

On GotFocus, the event sets the "AllowEdits" property to true. Then on LostFocus it sets it back to false.

I just got it working so I haven't thoroughly tested it, but so far it works great.

I'm leaving this here rather than deleting the question because I've seen a lot of related posts (none that were quite the same). So hopefully this will help some of you out.
 
Question For You...

Hello hollering,
...I currently use workgroup security with access 2k. But one problem I have is that for the user to change their password; either I have to do it by enabling shift-enter bypass or by walking the user through the same course of action. I am looking for a way to make it so a user can use a change password form - Thus I wouldn't have to be at their machine and also they wouldn't get to go and see all of the security info. Currently the security works very, very well - But if there was a better password managment tool without sacrificing security I would love to see it. You mentioned you use module security - Could you elaborate on that? And even let me see it?

I appreciate your assistance,
---roystreet

P.S. Or if anyone else reading this has a suggesstion, I would love to hear it!
 
The method I use provides pretty loose security. However, it works great for my purposes. I use a module and a small set of forms to manage all security and allow users to change their accounts. If you're still interested, I'll strip down my db tonight and post the module and its associated forms and tables.
 
The method I use provides pretty loose security. However, it works great for my purposes. I use a module and a small set of forms to manage all security and allow users to change their accounts. If you're still interested, I'll strip down my db tonight and post the module and its associated forms and tables.
 
hollering,
...If you don't mind, I'd love to see it.

Thanks,
---roystreet
 
No problem. I've been meaning to strip it down so I can import it more easily anyway. I'll work on it at home tonight and put it up here tomorrow.
 

Users who are viewing this thread

Back
Top Bottom