greyed text in form text box (1 Viewer)

SoxPats83

Registered User.
Local time
Today, 12:19
Joined
May 7, 2010
Messages
196
i am willing to bet there is a very simple solution to this problem. i have a text box that people will be entering information into, and prior to their clicking on it i was the text box too read something like "Enter Info Here" in a grey text that vanishes upon selecting the box. i'm sure there is a term for this and like i said before, probably a very simple solution.
 

dkinley

Access Hack by Choice
Local time
Today, 11:19
Joined
Jul 29, 2008
Messages
2,016
Well ... never did this before but if it was a text box I could envision setting the default value to "Enter text here" and in the OnOpen event of a New Record setting the control background color to grey.

But then you would have to validate the control to ensure they put something in it or "Enter text here" would be stored.

Well ... or ... depending on version, use a label like an overlay and on the OnClick event of the label have it go invisible and set the focus to the control.

-dK
 

SoxPats83

Registered User.
Local time
Today, 12:19
Joined
May 7, 2010
Messages
196
hmmm, that seems like a lot of hassle for what would ultimately be little reward. i appreciate the response, i was just hoping there would be something in the text box properties. thanks though.
 

FoFa

Registered User.
Local time
Today, 11:19
Joined
Jan 29, 2003
Messages
3,672
Could you not use the ON FOCUS event of the text box to wipe it out and change the color?
 

dkinley

Access Hack by Choice
Local time
Today, 11:19
Joined
Jul 29, 2008
Messages
2,016
The only reason I didn't suggest that was if the record was completed, the box would still be grey ... so suggested the coloring happen on the OnOpen event (If Me.NewRecord Then Me.txtControl.BackColor = .... ).

I think perhaps the 3 step process seemed to much of a hassle.

Now, if someone were to create another class or do some overloading .... :rolleyes:

-dK
 

Users who are viewing this thread

Top Bottom