How to make a textbox visible, when an item of a listbox is highlighted?

  • Thread starter Thread starter Normanf
  • Start date Start date
N

Normanf

Hi there,

I would like to make a textbox visible (unvisible)
according to some criteria, whilst the user has selected a
piticular item form the list of items of the Listbox.

Kind regards

Norman
 
Hi Norman,

Simply toggle the Visible property of the control. Put the code in the
Current event of the form and in the AfterUpdate event of the textbox.

If me.MyList = 2 then
me.MyText.visible=true
else
me.MyText.visible=false
endif

A shorter way of saying the same thing is:

me.MyText.visible=(me.mylist=2)

Since the visible property is a boolean you can assign it the boolean
results of the comparison and you get the toggle in a single statement.
 
sandra,
thanks
-----Original Message-----
Hi Norman,

Simply toggle the Visible property of the control. Put the code in the
Current event of the form and in the AfterUpdate event of the textbox.

If me.MyList = 2 then
me.MyText.visible=true
else
me.MyText.visible=false
endif

A shorter way of saying the same thing is:

me.MyText.visible=(me.mylist=2)

Since the visible property is a boolean you can assign it the boolean
results of the comparison and you get the toggle in a single statement.

--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.
Hi there,

I would like to make a textbox visible (unvisible)
according to some criteria, whilst the user has selected a
piticular item form the list of items of the Listbox.

Kind regards

Norman

.
 
Back
Top