VBA Table level validation - set to read only

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

anamque

Thread Starter
Joined
May 25, 2010
Messages
29
Hello, I have a 2007 Access database, where one of my tables has to be set to read only. The table acts as a "log table" - it captures the person's name, time in & time out (all of these fields work fine).

However, I do have to set the log table as read only or to not allow edits (whichever would be easier). We want to avoid someone going in and deleting a row of records. But still want to allow the table to continue to add rows with the user name and time as they continue to use the database.

I would much rather use a VBA code to add a table level validation b/c of the "sensitivity" of the data.

I've tried using this piece of code:


CurrentDb.TableDefs("Table1").ValidationRule = False

but have not had any luck yet....
 

anamque

Thread Starter
Joined
May 25, 2010
Messages
29
Since this expression is always false, Access won't allow any entries or alterations (so the table no longer creates/updates the log) .

I’m thinking I need something to prevent deletions on a table level in VBA.
 

OBP

Joined
Mar 8, 2005
Messages
19,895
Why prevent deletion in the table?
Why not hide the Tables and set the form to "No Deletions"?
 

anamque

Thread Starter
Joined
May 25, 2010
Messages
29
Due to security reasons - so the Log table is capturing users who enter in and out of the database, we need to prevent edits & deletions in order to ensure someone won't enter into the database, intentionally destroy or edit a record to their favor, and try to cover up the their tracks by editing the Log Table.

There is not a form where they interact with the data. The only form I have is acting as a switchboard, which will have shortcuts to the reports but never to the tables/queries/data...

Since I originally posted this question, I've received more information on my project......

To make a long story short, they are asking to implement a vba code where we identify users a, b, c are in a "admin" group, who have the ability to read, write, delete to all or some tables. I also have to identify users d, e, f who are in a "users" group, who have the ability to read only to some tables. I understand you can set users and permissions via Access - but for security reasons, I'm not allowed to utilize this feature.
 

OBP

Joined
Mar 8, 2005
Messages
19,895
Sorry this "you can set users and permissions via Access - but for security reasons, I'm not allowed to utilize this feature." does not make sense. Access User Level Security is far more Secure than VBA.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top