Undo or OldValue?

J

JethroUK©

receptionist keeps changing checkboxes accidentally (when deselecting
something else on the form) - obviously this is no good, so i figured i'd
disable single-click (works fine with double-click)

i can't see any built-in property to disable so i figure i'd intercept it
and put it back:

Private Sub L1_Unit8_Click()
L1_Unit8.Undo
L1_Unit8.OldValue
End Sub

i would prefer this took place like 'it never happened' - there's dozens of
checkboxes and some have default values & i dont want to dirty/create a new
record if poss

so the question is Undo or OldValue, if either?
 
D

Douglas J Steele

Undo should work.

However, why not just disable the checkboxes, and add a button to renable
them when you want them to be updatable?

To disable all checkboxes on a form, you can use code like:


Dim ctlCurr As Control

For Each ctlCurr In Me.Controls
If ctlCurr.ControlType = acCheckBox Then
ctlCurr.Enabled = False
End If

Next ctlCurr
 
J

JethroUK©

undo and oldvalue genrate an error when used on a new/null record

activating them as a batch could be too inconvenient (some boxes need
changing frequently - some dont) - hence i figured double-click would be
best - i wondered if there's anyway to cancel/abort single clicks using
checkbox.on_click method?

there is a way to cancel/abort in before-update event but i cant see how to
detect a click
 
D

Douglas J. Steele

You could try looking at the form's NewRecord property, but what about the
suggestion I made?
 
J

JethroUK©

Douglas J. Steele said:
You could try looking at the form's NewRecord property, but what about the
suggestion I made?

as i said - activating them as a batch could be too inconvenient (some
boxes need
changing frequently - some dont)

i thought it would be simple to negate single-click but it doesn't seem so -
i'm now thinking in terms of using a totally different control
 

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