I will assume that your "Invoice is Paid" is a yes/no field. Using the "On
Activate" event of the form you would use this code.
If Me!InvoiceIsPaid = True Then
Me.Form.AllowAdditions = False
Me.Form.AllowEdits = False
Me.Form.AllowDeletions =False
End If
If the "Invoice is Paid" is a text box just change this
If Me!InvoiceIsPaid = "Paid"
You can lock single controls with this code
If Me!InvoiceIsPaid = True Then
Me!FieldName.Enabled = False
End If
Hope this helps
> Hello Gentlemen!
>
[quoted text clipped - 5 lines]
> Thanks in advance
> Abe
Klatuu - 22 May 2008 19:25 GMT
The Activate event is not correct. It fires after the Load event when the
form is first opened and doesn't fire again unless you move to a different
form and back.
The form current event would be the correct event to use. Certainly you can
control controls indiviually, but the easiest way is:
With Me
If .NewRecord Then
.AllowEdits = True
ElseIf .txtInvoicePaid Then
.AllowEdits = False
Else
.AllowEdits = True
End If
End With
Or more simply:
Me.AllowEdits = Not Me.txtInvoicePaid Or Me.NewRecord
Assuming txtInvoicePaid is bound to a Yes/No field.

Signature
Dave Hargis, Microsoft Access MVP
> I will assume that your "Invoice is Paid" is a yes/no field. Using the "On
> Activate" event of the form you would use this code.
[quoted text clipped - 25 lines]
> > Thanks in advance
> > Abe