Not allowing changes to a form when a check box is selected

G

Guest

Hello,

I am trying to set up a shared database to not allow changes to a record,
via a form used for data entry, when a check box is selected. In other words,
we have a check box labelled "Closed" that users check when a case is closed
out and no more action is required. How do I "lock" the record when this
check box is checked?
 
G

Guest

Here's how I'm doing that, with code in the On_Current event of the form:

If chkBoxName = 0 Then
Me.AllowAdditions = True
Me.AllowDeletions = True
Me.AllowEdits = True

Else
' Me.AllowAdditions = False
Me.AllowDeletions = False
Me.AllowEdits = False

End If

I've commented out don't allow additions when the checkbox = -1 (checked) so
that I can add a new record.
 
G

Guest

Nice.

schasteen said:
You could simplify to

Me.AllowEdits = Not Me![CheckboxName]


Ricter said:
Here's how I'm doing that, with code in the On_Current event of the form:

If chkBoxName = 0 Then
Me.AllowAdditions = True
Me.AllowDeletions = True
Me.AllowEdits = True

Else
' Me.AllowAdditions = False
Me.AllowDeletions = False
Me.AllowEdits = False

End If

I've commented out don't allow additions when the checkbox = -1 (checked) so
that I can add a new record.
 
G

Guest

Thank you, very helpful!

Ricter said:
Here's how I'm doing that, with code in the On_Current event of the form:

If chkBoxName = 0 Then
Me.AllowAdditions = True
Me.AllowDeletions = True
Me.AllowEdits = True

Else
' Me.AllowAdditions = False
Me.AllowDeletions = False
Me.AllowEdits = False

End If

I've commented out don't allow additions when the checkbox = -1 (checked) so
that I can add a new record.
 

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