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]