Invisible Label

K

kensworld2

I could really use some help. I'm trying to do something seemingly
simple but to no avail.

I have a label set to invisible

When a text box on the same form (currency) goes below zero I want the
Visible property to turn on. I placed this code on the OnChange
property.



if me.txtTextBox < 0 then
me.lblLabel.visible = True
else
me.lblLabel.visible = False
end if

I know the control works. I attached the code to a command button to
test it. I can't seem to figure out how to trigger it.

Any help would be greatly appreciated.

Thanks in advance

Ken Brown
(e-mail address removed)
 
A

Andreas

For the OnChange event, you have to use
Me.txtTextBox.Text

I think the BeforeUpdate or AfterUpdate event for the control would be a
better choice, but that depends on the specifics of what you are doing.

Regards,
Andreas
 
G

Guest

First of all, you say you "placed this code on the OnChange property". I'm
assuming you mean that you placed the code in the Change event for the
textbox...? If not, do that.

Secondly, even if you do it still might not work. Does the textbox contain
a calculated value? If so, it changes in response to some other event, and
its own Change event won't fire. So instead attach your code to this other
event.

Thirdly, if you're changing the text box's VALUE in code, the Change event
STILL won't fire, so change its TEXT property instead.

Hope one of the above helps.
 

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