Visible Property

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to hide some fields on a form when a selection is made from a combo box. I defined the If statement to run from the Change Event. The fields do hide when you pick the combo box selection to hide, but when you come back to the record the fields aren't hidden any more. It also seems to affect all the records of the database. If the fields are hidden in record #1, so are record #2, and so on

Private Sub Combo151_Change(
If Me!Combo151 = 2 The
Me!PONumber.Visible = Fals
Me!PioneerQuoteNumber.Visible = Fals
Me!SAPSalesOrderNumber.Visible = Fals
Me!SAPAccountNumber.Visible = Fals
Me!SAPDelivery.Visible = Fals
Els
Me!PONumber.Visible = Tru
Me!PioneerQuoteNumber.Visible = Tru
Me!SAPSalesOrderNumber.Visible = Tru
Me!SAPAccountNumber.Visible = Tru
Me!SAPDelivery.Visible = Tru
End I
End Sub
 
Place your If statement in the OnCurrent event of the form also.

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


Glenn said:
I need to hide some fields on a form when a selection is made from a combo
box. I defined the If statement to run from the Change Event. The fields
do hide when you pick the combo box selection to hide, but when you come
back to the record the fields aren't hidden any more. It also seems to
affect all the records of the database. If the fields are hidden in record
#1, so are record #2, and so on.
 
Lynn

That works

Thank

----- Lynn Trapp wrote: ----

Place your If statement in the OnCurrent event of the form also

--
Lynn Trap
MS Access MV
www.ltcomputerdesigns.co
Access Security: www.ltcomputerdesigns.com/Security.ht


Glenn said:
I need to hide some fields on a form when a selection is made from a comb
box. I defined the If statement to run from the Change Event. The field
do hide when you pick the combo box selection to hide, but when you com
back to the record the fields aren't hidden any more. It also seems t
affect all the records of the database. If the fields are hidden in recor
#1, so are record #2, and so on
 
Back
Top