ghost text or placeholder for textbox

guestbb

Registered User.
Local time
Today, 00:31
Joined
Jul 14, 2015
Messages
44
I would like to put an example text in some textboxes so that when people type in them they now what or in what form to type.
I have seen this in forms online, kind of a ghost (shadowy) text is displayed when the textbox is empty, and when you click or start typing in the textbox it dissapears.
Does anyone know how to do this?
 
you could make the text box:
the interior color ,white or transparent.
text color, light gray

on KEYDOWN event()
text color =vbBlack
 
ok. but how do i make it say in the textbox for example "First Name"?
And then when you click on the textbox or start writing it dissapears and i can type normally.
And also that it doesnt save the ghost text as something that is inserted in the textbox.
 
In the format property of the textbox, type this:

@;"Your ghost text to disappear"
 
Where is format property of the textbox exactlly? Where do I find it in the options?

EDIT: Found it. Thank you guys very much!!!
 
property of the text box
default value:
 
Is there any way to combine this method with another format?

For example, is there a way to enter @;"Date" in the format property AND "short date" so that the field will still be a date field?

Or @;"Price" for the placeholder AND "Currency" as the actual format??

Thanks
 
You could also use VBA to do this so you can bind it to a control or event. I've used the code below to set the value of a text box, then when a user clicks inside the text box, it erased the default value. I think you can combine this with some VBA code to change your format too. For example:




Me!FieldToEdit.Format = "Medium Date"



FieldToEdit.Value = "Form #"



If FieldToEdit.Value = "Form #" Then

FieldToEdit.Value = ""

End If
 

Users who are viewing this thread

Back
Top Bottom