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

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
 
S

Sandra Daigle

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.
 
G

Guest

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

.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top