Check boxes - Can I intercept the checking of...?

M

Maxwell

So I have a check box on a form that is attached to a field on a Link Table.
If you do not have a record created yet and click the check box, the whole
thing hangs - there is no primary key set.

So what I want to do is run an if/then function which checks/unchecks the
box if there is information in the main field (which contains a key on the
Link Table record) and does not if said field is empty. However, I can't see
where the checkbox action comes in.

I'm hesitant to use [Control].enabled because this is on a continuous
subform, so turning one instance on/off seems to turn the whole set off.

Grateful for any views on this...

Max
 
A

Amy E. Baggott

You can use the checkbox.enabled property. You just need to set it in the
OnCurrent Event. That way, it's only looking at the current record.
Something like:

Form_OnCurrent

If isNull(me.field1) Then
me.checkbox1.enabled = false
Else
me.checkbox1.enabled = true
End If

Hope this helps.
 

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