D
Duck
I have a form with a control called [ContactType] that I want to be
either visible or invisible dependant on the value of a checkbox
called [Contacts]. The problems is that the coded works fine when
attached to the click event of the [Contacts] checkbox. However I
can't get the [ContactType] to be visible when the form first loads
with a clients data. It doesn't seem to matter which form event for
the form I tie the code to the value of the checkbox is always null.
But if I check the value of the checkbox after the form is loaded and
displaying the record it is either -1 or 0 (of course depending on
whether or not it is checked). The code is simple:
'Open with ContactsType inactive if the patient does not wear them
chkContacts.Requery
Debug.Print "Value is " & Forms!frmCustomerInput!
cmbContactType.Value
If IsNull(Forms!frmCustomerInput!chkContacts.Value) Then
Debug.Print "It is nullg"
End If
If chkContacts.Value = 0 Then
Debug.Print "No Contacts " & chkContacts.Value
cmbContactType.Enabled = False
cmbContactType.Visible = False
LblContactType.Visible = False
End If
If chkContacts.Value = -1 Then
Debug.Print "Contacts True " & chkContacts.Value
cmbContactType.Enabled = True
cmbContactType.Visible = True
LblContactType.Visible = True
End If
either visible or invisible dependant on the value of a checkbox
called [Contacts]. The problems is that the coded works fine when
attached to the click event of the [Contacts] checkbox. However I
can't get the [ContactType] to be visible when the form first loads
with a clients data. It doesn't seem to matter which form event for
the form I tie the code to the value of the checkbox is always null.
But if I check the value of the checkbox after the form is loaded and
displaying the record it is either -1 or 0 (of course depending on
whether or not it is checked). The code is simple:
'Open with ContactsType inactive if the patient does not wear them
chkContacts.Requery
Debug.Print "Value is " & Forms!frmCustomerInput!
cmbContactType.Value
If IsNull(Forms!frmCustomerInput!chkContacts.Value) Then
Debug.Print "It is nullg"
End If
If chkContacts.Value = 0 Then
Debug.Print "No Contacts " & chkContacts.Value
cmbContactType.Enabled = False
cmbContactType.Visible = False
LblContactType.Visible = False
End If
If chkContacts.Value = -1 Then
Debug.Print "Contacts True " & chkContacts.Value
cmbContactType.Enabled = True
cmbContactType.Visible = True
LblContactType.Visible = True
End If