I have a form with many textboxes and a few listboxes. I want to hide specific textboxes depending on what is selected in the listbox. I've tried the following, but it only seems to work for ProcessID = 3.
With my code none of the textboxes are hidden for ProcessID =1 or 2, but they should be hidden.
Any suggestions?
Thanks,
Brian
Code:
Private Sub lbxProcessID_AfterUpdate()
If Me![lbxProcessID] = 1 Then
Me!lbxTrainOrderID.Visible = False
Me!tbxPileAdjustment.Visible = False
End If
If Me![lbxProcessID] = 2 Then
Me!tbxPileAdjustment.Visible = False
End If
If Me![lbxProcessID] = 3 Then
Me!lbxTrainOrderID.Visible = False
Else
Me!lbxTrainOrderID.Visible = True
Me!tbxPileAdjustment.Visible = True
Me!tbxStackingTubeAdjustment.Visible = True
End If
End Sub
With my code none of the textboxes are hidden for ProcessID =1 or 2, but they should be hidden.
Any suggestions?
Thanks,
Brian