Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Predefined text to a text field with no data.

Status
Not open for further replies.

sagamw

Technical User
Nov 11, 2009
104
GR
If you go to MSDN
like this page


You have a search box which says (in italics) Search MSDN with Bing. When you click on it, the text disappears for user input. If you don't write anything, it's there again/

Is there a way to have something like this in Access 2007?
I don't mean the default value.
Just a sentence, which after the user clicks in the field will disappear.
 
You can set the Tag property to your "Search MSDN with Bing". Then add code to your Form Open and text box Got Focus like:
Code:
Private Sub Form_Open(Cancel As Integer)
    If IsNull(Me.txtDescription) Then
        Me.txtDescription = Me.txtDescription.Tag
    End If
End Sub

Private Sub txtDescription_GotFocus()
    If Me.txtDescription.Text = Me.txtDescription.Tag Then
        Me.txtDescription = Null
    End If
End Sub

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top