Private Sub strInsurance_AfterUpdate()
If Me.strPrimaryInsurance = "HMO" Then
Me.[strAuthMedication] = "1"
Else: Me.[strAuthMedication] = " "
End If
End Sub
Did you put this code on the after update event of the combo?
The name of the sub "strInsurance" is not the same as the field you
comparing the text with "strPrimaryInsurance ", it should be the same
Private Sub ComboName_AfterUpdate()
If Me.ComboName = "HMO" Then
Me.[strAuthMedication] = True
Else
Me.[strAuthMedication] = False
End If
End Sub
Or to make it shorter
Private Sub ComboName_AfterUpdate()
Me.[strAuthMedication] = (Me.ComboName = "HMO")
End Sub
***** Note *****
1. Make sure that you use this code on the after update of the combo,
2. The example I gave it say ComboName, need to be your combo name
--
Good Luck
BS"D
Kathy said:
Sorry I am "painfully" new at this and I appreciate your patience. Here is
what I have so far:
Private Sub strInsurance_AfterUpdate()
If Me.strPrimaryInsurance = "HMO" Then
Me.[strAuthMedication] = "1"
Else: Me.[strAuthMedication] = " "
End If
End Sub
It is working in the sense that if I close the record and then come back in
again, then the OptionYes radio button is active (or green). But I would like
that as I enter the HMO selection from primary insurance combo box, then the
option radio button would automatically turn active. Thank you again...
--
Kbelo
Ofer Cohen said:
What do you mean it doesn't work?
Do you get an error message or the check box is not set?
Where did you put this code?
Use the After Update event of the [strInsurance] combo (if you didn't
already), and write the code
Me.OptionYes = (Me.[strInsurance] = "HMO")
Does the combo has also Id to the insurance?
In that case you might need to try
Me.OptionYes = (Me.[strInsurance] = 1) ' depending on the ID of HMO
--
Good Luck
BS"D
:
I have a feeling that this question is going to be embarrassingly easy, but
here goes:
I have a combo box that when one of the selections is chosen, the option
group button for Yes is active.
I am using an If-Then statement:
If [strInsurance] = "HMO" Then
OptionYes = True
But it'snot working...any help is greatly appreciated. Thank you.