I have two drop-down list boxes: LB1 and LB2. LB1 pulls values from an Access table and LB2 then displays a filtered list of options (also pulled from an Access table) based on LB1's value. So far, so good.
The issue is that if the user then goes back and changes the value of LB1, now LB2 is set to a potentially wrong value so I would like to reset LB2 when LB1 is changed, so the user is forced to go back and reselect. I know how to achieve this with VBA in Access, but I'm having trouble with VB. Here's an example in VBA:
Private Sub lblDisciplineID_AfterUpdate()
Static DisciplineUPDated As String
If DisciplineUPDated = "" Then DisciplineUPDated = Me.lblDisciplineID.OldValue
Me.lblDetail_Type.Requery ' This refreshes the query that populates the combo box in the Access form
If DisciplineUPDated <> Me.lblDisciplineID.Value Then
Me.lblDetail_Type.Value = Null
Me.lblSubfolderID.Value = Null
DisciplineUPDated = Me.lblDisciplineID.Value
End If
Me.lblDetail_Type.SetFocus
End Sub
Any help with how I could do something similar in Infopath with VB (or any other method I might be overlooking) would be greatly appreciated. I've already tried using Rules but I can't seem to find a solution. Thanks!