display "enter date" (1 Viewer)

tubar

Registered User.
Local time
Today, 03:13
Joined
Jul 13, 2006
Messages
190
im new...I was wondering if I could display "enter date" in my date text box on my form...when the user selects the text box, "enter date" disappears
 

tubar

Registered User.
Local time
Today, 03:13
Joined
Jul 13, 2006
Messages
190
i tried what you suggested...since my field is formatted for time it didn't like when I inputted text. any other suggestions
 

tubar

Registered User.
Local time
Today, 03:13
Joined
Jul 13, 2006
Messages
190
I would have thought "tag" would help in this instant, but it doesn't. Again what I am trying to do is instead of having a label next to my text box that says "enter date here", I want "enter date here" inside my text box...the message goes away when the user is inside the textbox. the textbox is formatted for date and time.

any other suggestions?
 

pr2-eugin

Super Moderator
Local time
Today, 09:13
Joined
Nov 30, 2011
Messages
8,494
Something like this??
Code:
Private Sub dateControlName_GotFocus()
    If Len(Me.dateControlName & vbNullString) <> 0 Then
        Me.dateControlName.Format = "Short Date"
    End If
End Sub

Private Sub dateControlName_LostFocus()
    If Len(Me.dateControlName & vbNullString) = 0 Then
        Me.dateControlName.Format = ""
        Me.dateControlName = "Enter a date !"
    End If
End Sub
Change the dateControlName to match your design..
 

rkl122

Registered User.
Local time
Today, 01:13
Joined
May 13, 2013
Messages
28
Another possibility: overlay a transparent text box with properties set so it doesn't permit data entry but whose value is blanked from the on click event of your date entry control. (Untested. Just based on an idea I read about somewhere.)

-Ron
 

pr2-eugin

Super Moderator
Local time
Today, 09:13
Joined
Nov 30, 2011
Messages
8,494
The problem is the OP wants Date/Time format in a single field. That's why I suggested a Date field and a separate Time field, then you could concatenate them together if needed.
Am :confused: I read the thread again, I cannot seem to see the OP stating such a request.. Am I really loosing it today? :eek:
 

Dewi

Registered User.
Local time
Today, 01:13
Joined
Jun 18, 2012
Messages
26
A simple solution is to enter @;"enter date" in the "format" property of the text box.
 

Users who are viewing this thread

Top Bottom