I have an Order Form using cascading combo boxes using very simple VBA.
- The first combo box called "PayorType", filters the second combo box called "PayorID".
- There are four PayorType value selections: Insurance, Employer, Self, Other
Private Sub cboPayorType_AfterUpdate()
cboPayorID.RowSource = "Select tblPayors.PayorID, ..... etc etc. "
"FROM tblPayors " & _
"WHERE tblPayors.PayorType = '" & cboPayorType.Value & "' " & _
"ORDER BY tblPayors.PayorID;"
End Sub
Now that I've got that working..... my next step is to make sure users fill out the four fields of health insurance information (InsuredName, RelationshipTo, PolicyNumber, GroupNumber) if "Insurance" PayorType is chosen.
From what I can gather after researching, this appears to be an AfterUpdate action on the same PayorType control.
Is it possible to have two actions on one control AfterUpdate? If so, I would first run the VBA to filter the cascading combo box. Second, I would want the focus to go to the InsuredName field if PayorType = "Insurance" - otherwise, skip to the Order Detail subform.
If this isn't impossible, I'd just be happy if there is a way to pop up a message box based on PayorType ="Insurance" before the form closes.
Thank you for your attention!
Andi