Display Desired Format in Field, Clears on Focus (Easy question, I hope) (1 Viewer)

RogueJD

Access Beginner
Local time
Today, 19:00
Joined
Jan 13, 2010
Messages
30
Hey all.

I'm using a form to enter data. On the form, there's input fields for basic stuff. Last name, first name, middle, etc.

Aside from using a label on the field, is there a way to display default data in the input field that is cleared when selected?

Intent:
The input field for "FName" would have the text "First Name" displayed in it (Maybe greyed out?). Upon selecting the input field, the text "First Name" is automatically cleared so that the user doesn't have to select and delete it.

Thanks all!
 

John Big Booty

AWF VIP
Local time
Tomorrow, 03:00
Joined
Aug 29, 2005
Messages
8,263
You could do this by Setting the Field's Default Value to First Name, then in it's Got Focus event put the following code;
Code:
    If Me.FName = "First Name" Then
        Me.FName = ""
    End If

You could play with conditional formatting in the field to change "Grey Out" the default value and set it to normal once that is changed.
 

RogueJD

Access Beginner
Local time
Today, 19:00
Joined
Jan 13, 2010
Messages
30
That's brilliant. Thanks, Mr., uhh... Big Booty. :)
 

Users who are viewing this thread

Top Bottom