Read-Only Record

  • Thread starter Thread starter David G. Hoch
  • Start date Start date
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
 
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
 
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
 
Back
Top