Make records "unchangeable"

  • Thread starter Thread starter Edgar Chado via AccessMonster.com
  • Start date Start date
E

Edgar Chado via AccessMonster.com

Hi to all,

Is there a way to "commit" a record in a form and make it "unchangeable".
In other words, I need to put a button in a form wich will save the current
record and won?t let anyone change it anymore.

Is this possible???

Thanks
 
Add another field True/False So when you commit update the field to true, and
when you access the current record if it true then lock the rest of the
fields, else ...
 
Ofer,

I understand what you are saying. I am using access for the first time.
could you please give me a hint?

Thanks.
 
Hi to all,

Is there a way to "commit" a record in a form and make it "unchangeable".
In other words, I need to put a button in a form wich will save the current
record and won?t let anyone change it anymore.

If you want to do this *always*, for all records, you can open the
Form in design view and set its Allow Additions property to True and
its Allow Edits property to False.

If you want to selectively do this for some records but not for
others, it is more complicated. As Ofer suggests, what you need to do
is open your table in design view; add a new field, a Yes/No field
(I'll call it Complete) which will be set to True when the record is
locked. On your Form you can use a checkbox for this field (instead of
a button). You will then need two bits of VBA code. In the checkbox's
AfterUpdate event use code:

Private Sub Complete_AfterUpdate()
Me.AllowEdits = Not Me!Complete
End Sub

and the Form's Current event similarly:

Private Sub Form_Current()
If Not Me.NewRecord Then
Me.AllowEdits = Not Me!Complete
End If
End Sub


John W. Vinson[MVP]
 
Back
Top