Hello. new to this forum. i have a form where i have created a 2-value toggle control ("optFindMethod"). the 2-value options show as toggle buttons("tglFindMethBatchRef" and "tglFindMethZrteID"), with option values of 1 and 2 respectively. if the user selects option 1, i want to turn on edit ability of some fields that are specific to search method 1 AND turn off fields that are specific to search method 2. the code kind of works, but i always seem to be able to get into some fields and not others. also, not sure the best place to do the "checking".
the "cbo" fields are combo boxes, that i allow user selection of some data. eventually, i want to add some additional fields related to each search method.
Code:
Private Sub SetFindMethod()
'optFindMethod is an option group
' value 1 is search by QicLink Batch/Ref Num
' value 2 is search by ZRTE Master Claim ID
'
If Me.optFindMethod = 1 Then
'batch ref num search true
Me.cboQLBtchRef.Locked = False
Me.cboQLBtchRef.TabStop = True
Me.cboQLBtchRef.Enabled = True
Me.cboQLBtchRef.SpecialEffect = 2
'zrte id search false
Me.cboZrteID.Locked = True
Me.cboZrteID.TabStop = False
Me.cboZrteID.Enabled = False
Me.cboZrteID.SpecialEffect = 2
ElseIf Me.optFindMethod = 2 Then
'zrte id search true
Me.cboZrteID.Locked = False
Me.cboZrteID.TabStop = True
Me.cboZrteID.Enabled = True
Me.cboZrteID.SpecialEffect = 0
'batch ref num search false
Me.cboQLBtchRef.Locked = True
Me.cboQLBtchRef.TabStop = False
Me.cboQLBtchRef.Enabled = False
Me.cboQLBtchRef.SpecialEffect = 2
Else
Beep
MsgBox "Something is Wrong with FIND METHOD settings ... "
End If
Me.Repaint
DoEvents
End Sub
Private Sub tglFindMethBatchRef_KeyUp(KeyCode As Integer, Shift As Integer)
Call SetFindMethod
End Sub
Private Sub tglFindMethBatchRef_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call SetFindMethod
End Sub
Private Sub tglFindMethZrteID_KeyUp(KeyCode As Integer, Shift As Integer)
Call SetFindMethod
End Sub
Private Sub tglFindMethZrteID_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Call SetFindMethod
End Sub
any help in steering me in the right direction would be appreciated