Disabling unticking of tick boxes

J

John

Hi

I have a tick box on a continuous form. What I need is to disallow unticking
of a tick box once it has been ticked. How can I achieve this on a
continuous form?

Thanks

Regards
 
J

John W. Vinson

Hi

I have a tick box on a continuous form. What I need is to disallow unticking
of a tick box once it has been ticked. How can I achieve this on a
continuous form?

Thanks

Regards

This seems a very strange thing to do (the user checks a box by mistake and is
forbidden from correcting that mistake!?), but you can use a line of code in
the checkbox's AfterUpdate event:

Private Sub chkMyCheckbox_AfterUpdate()
Me!chkMyCheckbox = True
End Sub

This will set it to True (checked) whenever the user alters its value - if she
sets it to True this just sets it to True again, if she sets it to False it
gets set back to True.

Steve's suggestion will prevent either unchecking OR checking it,
unfortunately.
 
J

John Spencer

Set the Tick box control's validation property to true. Once a record
associated with the form has been "ticked" and saved, you cannot change
the value on the form to unchecked.



'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 
M

[MVP]

Hi

I have a tick box on a continuous form. What I need is to disallow unticking
of a tick box once it has been ticked. How can I achieve this on a
continuous form?

Thanks

Regards

Hi,

Private Sub chkMyCheckbox_AfterUpdate()
If chkMyCheckbox = False Then
chkMyCheckbox = True
End If
End Sub

It will allow to tick the checkbox, but it won't allow to be set as
False.

Regards,
Branislav Mihaljev
Microsoft Access MVP
 

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

Similar Threads


Top