Thank You both,
The problem seems though, that IsMissing isn't working correctly.
To double check, I Dimmed a Boolean and set it to IsMissing(param_name) put a breakpoint in and checked the value of it when the procedure was called without the optional argument. It remained false. I submit the code in hope that I've done something wrong and you can correct it.
'Enables or disables controls on form frmFindCourses depending on
'the value of the control's corresponding CheckBox.
Public Sub After_Update_Checkboxes(checkbox_name As CheckBox, _
control_name As Control, _
Optional changeCost As String, _
Optional eqOp As OptionGroup)
Dim form1 As Form, test As Boolean, test2 As Boolean
Set form1 = Form_frmFindCourses
'If the CheckBox is ticked...
If checkbox_name = True Then
'...then enable the CheckBox's corresponding control.
control_name.Enabled = True
test = IsMissing(eqOp)
test2 = Not test
If test Then
eqOp.Enabled = True
End If
If Not IsMissing(changeCost) Then
If IsNull(form1![Cost Type]) Then
form1![CostType Check].Value = True
form1![Cost Type].Enabled = True
form1![Cost Type] = changeCost
End If
End If
Else
'Disable and clear the checkbox's corresponding control.
control_name.Enabled = False
control_name.Value = Null
If Not IsMissing(eqOp) Then
eqOp.Enabled = False
eqOp.Value = eqOp.DefaultValue
End If
End If
End Sub
This is the procedure that calls it.
Private Sub ArrangeBy_Check_AfterUpdate()
Call After_Update_Checkboxes([ArrangeBy Check], [Arranged By])
End Sub
Thanks in advance for any help,
Cheers,
Pete