Making a label visible with a combo box

  • Thread starter Thread starter Graham
  • Start date Start date
G

Graham

I have a simple form with some fields and a combo box. What I want to be
able to do is control a label (lblScrapped) making it visible when a field
(comboStatus) says 'Scrapped' and not visible is the same field says
'Network' or 'Standalone'.

Can someone please suggest a way that I can achieve this little problem.

Thanks,

Graham.
 
I have a simple form with some fields and a combo box. What I want to be
able to do is control a label (lblScrapped) making it visible when a field
(comboStatus) says 'Scrapped' and not visible is the same field says
'Network' or 'Standalone'.

Can someone please suggest a way that I can achieve this little problem.

Thanks,

Graham.

Code the current event of the Form, as well as the AfterUpdate event
of the combo box:

Me!lblScrapped.Visible = Me!ComboName = "Scrapped"

The above assumes the bound column of the combo box is text.
 
You could use the AfterUpdate event of the combo, and the Current and Undo
events of the form to set the Visible property of your text box.

However, it would be simpler to replace the label with a text box and give
it this ContolSource:
=IIf([comboStatus]="Scrapped", "Scrapped", Null)

Note that if you used the lookup wizard to create this field in your table,
then the value you are seeing in the combo may not be what Access is storing
in your table. If you run into this problem, see:
The Evils of Lookup Fields in Tables
at:
http://www.mvps.org/access/lookupfields.htm
 
Back
Top