Hello, I am trying to make a form that only has certain fields visible based on a selection within an option group. I have a script to change the visibility states based on what is selected.
Based on the selection within the combo box (1, 2, 3, 4, 5, or
nothing<- when i make a new record. I would like to update the objects so that only the ones that I want to be visible are visible.
Also... I would like to be able to view the relevant fields for each record as I am scrolling through the records. (Based on the selection in the option group)
Thank you!
Code:
Private Sub ffoVis()
Me.EventDate.SetFocus
Me.lblPackRecv.Visible = False
Me.Packages_Received.Visible = False
Me.lblPackCount.Visible = False
Me.txtPackCount.Visible = False
Me.lblWhere.Visible = False
Me.txtWhere.Visible = False
If Me.Contact_Type.Value = 2 Then
Me.lblWhere.Visible = True
Me.txtWhere.Visible = True
Me.Packages_Received.Value = Null
Me.txtPackCount.Value = Null
ElseIf Me.Contact_Type.Value = 5 Then
Me.lblPackRecv.Visible = True
Me.Packages_Received.Visible = True
Me.lblPackCount.Visible = True
Me.txtPackCount.Visible = True
Me.txtWhere.Value = Null
Else
Me.Packages_Received.Value = Null
Me.txtPackCount.Value = Null
Me.txtWhere.Value = Null
End If
End Sub
Based on the selection within the combo box (1, 2, 3, 4, 5, or
nothing<- when i make a new record. I would like to update the objects so that only the ones that I want to be visible are visible.
Also... I would like to be able to view the relevant fields for each record as I am scrolling through the records. (Based on the selection in the option group)
Thank you!