dwe0608
asked on
URGENT: Best Coding Practise - # 1
I have a series of checkboxes on a form - I need to test the value of one of two fields on the click event ... I currently do it as follows :
Private Sub chkFields_Click(Index As Integer)
Select Case Index
Case 7
If chkFields(7).Value = vbChecked Then
chkFields(8).Value = vbUnchecked
Else
chkFields(8).Value = vbChecked
End If
Case 8
If chkFields(8).Value = vbChecked Then
chkFields(7).Value = vbUnchecked
Else
chkFields(7).Value = vbChecked
End If
End Select
End Sub
Is there a simpler (ie shorter coding) way of achieving this ?
What is the best coding practise to achieve the result ?
MTIA
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
for example you have only 2 options to select 4 a particular problem like sex add a frame and draw 2 option buttons in it. then use it without coding like above. Because user only will be permitted to select either one of the option button from a group without any extra coding.