Read-Only Record

D

David G. Hoch

Is it possible to make a single record in a table Read-Only? I have one
record that I would want to prevent users from changing. All of the other
records in the table need to remain non-read-only records.

Any advice would be greatly appreciated.

Thanks,
--David
 
T

TC

Are all the users accessing the table *via a form*, and not directly?
If so, you could put the following code into the Current event of the
form:

if me![field_1]=11 and me![field_2]="abc" then
' lock the record.
me.allowedits = false
me.allowdeletions = false
else
' unlock the record.
me.allowedits = true
me.allowdeletions = true
endif

Naturally you'd replace the first lne of that code, with whatever test
you needed to identify the record in question.

Of course, they could still go *directly into the table* and edit or
delete the record.

HTH,
TC (MVP Access)
http://tc2.atspace.com
 
S

Scott A

Humble suggestion from an amateur:
You could have everyone else edit data through queries and forms that
filtered out the record in question, but the full table would still be
available for reports. TC's programming solution sounds more elegant, but my
solution might be easier to tweak or debug. Good luck!
-Scott
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top