Log in

View Full Version : Solved: I have made a mess



kbsudhir
08-15-2009, 05:05 PM
Hi All,

I am using Access 2003 in my office. I display all the records pulled by the queries in a datasheet view in subform. Also edit the records in the subform.

I changed the properties of both my Parent form & subform i.e enabled & Locked to No & Yes respectively also I changed the "Allow Edit" property to "No", as I do not want everbody to change the records.

I use VBA.environ("Username") to find the user & get the data from the table to ensure whether he has the right to change/edit any records.

Now I got two problems:

1. I was not able to change the properties through VBA.
2. Even when I manually changed the properties of both parent & sub form still not able to change the records.


Well, due to weekend I decided to test the issue at my house where I have Access 2007. Here in default setting I am not able change any records....!!!!!!!!!!!

I am so confused :banghead: :banghead: :banghead: :banghead:


Please let me know where I could be messing & have not changed anything in the test database in access 2007 still issue continues to haunt me.

Regards
Sudhir

Norie
08-16-2009, 04:39 AM
Sudhir

Why/how are you using Environ?

Why not just use the built-in security functionality that Access has?

kbsudhir
08-16-2009, 04:53 AM
I have a bunch of macros which are updating the tables in the background from various outlook clients.

If I add login functionality then I have to change the connection string in all the macros which is not feasible at the moment.

kbsudhir
08-16-2009, 09:08 AM
Guys,

I need some guidance on how to enable edit in the form/sub-form.

Pleaseeeeeeeeeeeeeeeee

Rgds
Sudhir

CreganTur
08-17-2009, 05:16 AM
Maybe I'm not understanding your problem, but if you want to edit records through a form, you have to change the Allow Edit property back to Yes. Otherwise Access will lock out any changes you try to make.

kbsudhir
08-20-2009, 03:51 PM
Yes, Randy.

This is how I fixed the issue. I changed allow edit property to yes. I extracted the users role at the form load itself. At the button click which will pull the data to be edited. The macro will check the role & role is not "Supervisor" then It will show a message.

Thanks Randy & Noorie for your valuable time.

Anybody trying somekind of role based authentication in access, please PM me & will share the code.

Regards
Sudhir