Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / July 2007

Tip: Looking for answers? Try searching our database.

Message box

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Amy - 19 Jul 2007 00:46 GMT
Can someone help me with the code to trigger a message box when a certain
form field has the focus?  When someone hits these particular fields, I just
want them to see a reminder about the content of the field.

Thanks in advance!
NZ VBA Developer - 19 Jul 2007 03:38 GMT
Assuming you're talking about a field on a userform, I suggest looking in the
VBA help for information on the 'Enter' event. The code should look something
like this:

Sub TextBox1_Enter
   MsgBox "Don't forget..."
End Sub

However, if you are talking about a form field in document, then the process
is a little different. In this case you will need to create a macro in the
template that looks something like this:

Sub Reminder()
   MsgBox "Don't forget..."
End Sub

And then in the properties dialog box of the formfield select this macro to
run on entry to the field. If you don't want the same message displayed for
each field, you'll need to create similar macros for each and assign the
specific macros to the appropriate field.

Note that this only appears to work if the document is forms protected.

Cheers!

> Can someone help me with the code to trigger a message box when a certain
> form field has the focus?  When someone hits these particular fields, I just
> want them to see a reminder about the content of the field.
>
> Thanks in advance!
Amy - 19 Jul 2007 12:42 GMT
That's perfect!  Thank you so much!

> Assuming you're talking about a field on a userform, I suggest looking in the
> VBA help for information on the 'Enter' event. The code should look something
[quoted text clipped - 26 lines]
> >
> > Thanks in advance!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.