Clear Displayed memobox instructions

borisbruno

Registered User.
Local time
Yesterday, 18:34
Joined
Oct 14, 2005
Messages
39
Hello,

I'm new at this, but here goes. I have a memobox on a form that I set the DefaultValue to display instructions for what to enter in the memobox. I would like these instructions to be visible until the user clicks or tabs into the box. Then I would like these instructions to disappear when the user begins to type something in. I've tried using several different event scenarios, but none does exactly what I want. I don't want to use a control tip as it won't appear until the user actually enters the memobox and I want the instructions to be visible before that time. However, this is what I've done at this point because I haven't been able to fiqure out how else to do what I want to do.

Any help would be appreciated; I'm sure this is something very simple for all of you, but I've spent several hours trying to work my way through this.

Thanks, Charlotte

P.S. I've read many of the posts, and have gathered many helpful tips on a variety of Access topics. Thanks to all of you out there!
 
You could set the default value of the control to display your message and then set the got focus event to:

Private Sub control_GotFocus()
Me.control = Null
End Sub

Pete
 
Pete,

Thanks for your quick response; I'll try it.

Charlotte
 
PeteJM said:
You could set the default value of the control to display your message and then set the got focus event to:

Private Sub control_GotFocus()
Me.control = Null
End Sub

Pete
What happens if the user clicks the memo field of an old record? That would wipe it out. You would need to do some testing before you Null it out.
 
ghudson,

You're right, that's exactly what happened. The same as when I tried setting the field to an empty string on GotFocus and OnClick. I'm not sure how to structure the If Then test for an existing value in the memobox. I'll have to search around the forum and see what I turn up. It may be easier to just use a tooltip.

Thanks to both of you though. Charlotte
 
You can try something like this...

Code:
Private Sub TextBox1_GotFocus()

If Me.TextBox1 = "My special instructions." then
     Me.TextBox1 = Null
else
     msgbox "false" 'just for testing
end if

End Sub
 
ghudson,

Thank you. This appears to be doing what I want it to do.

Charlotte
 

Users who are viewing this thread

Back
Top Bottom