Check box code

MartinO

Registered User.
Local time
Today, 18:45
Joined
Oct 8, 2002
Messages
22
Having problems getting this code to work on a form using ‘On Current’ event.


If IsNull([MECHOPNO]) = True Then
[Check310].Enabled = True
Else:
[Check310].value = "No"
[Check310].Enabled = False

If IsNull([ELECOPNO]) = True Then
[Check308].Enabled = True
Else:
[Check308].value = "No"
[Check308].Enabled = False

End If
End If


‘MECHOPNO’ and ‘ELECOPNO‘ are text fields

The need has arisen as users are sometimes inadvertently checking both check boxes unnecessarily which gives errors in an associated report.

If text is entered into ‘MECHOPNO’, check 310 is disabled and seems to work OK
But entering text into ‘ELECOPNO’ doesn’t disable check308

Anyone got any ideas?
 
You are trying to assign a text value to a checkbox.

Code:
If IsNull([MECHOPNO]) = True Then 
    Me.Check310.Enabled = True 
Else 
    Me.Check310 = False
    Me.Check310.Enabled = False 
End If

If IsNull([ELECOPNO]) = True Then 
    Me.Check308.Enabled = True 
Else 
    Me.Check308 = False
    Me.Check308.Enabled = False 
End If
 
Many Thanks - that works beautifully
 

Users who are viewing this thread

Back
Top Bottom