Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-05-2017, 07:18 AM
pharrison pharrison is offline Drop down with warning Windows 10 Drop down with warning Office 2010 64bit
Novice
Drop down with warning
 
Join Date: Jul 2017
Posts: 12
pharrison is on a distinguished road
Default Drop down with warning


Hello all. I currently have a form with drop down choices. There is one option that when chosen I would like to have it come up with a warning.

Is this possible in Word. Newbee at adding VBA into Word docs.


Thanks

Pete
Reply With Quote
  #2  
Old 07-05-2017, 02:35 PM
macropod's Avatar
macropod macropod is offline Drop down with warning Windows 7 64bit Drop down with warning Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Yes, it's possible, but not without knowing: what type of dropdown; what the option is; or what the warning is.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 07-06-2017, 05:48 AM
pharrison pharrison is offline Drop down with warning Windows 10 Drop down with warning Office 2010 64bit
Novice
Drop down with warning
 
Join Date: Jul 2017
Posts: 12
pharrison is on a distinguished road
Default form

Here is a screen shot of the form. It is just a basic combo box. They option that needs the warning is Litigation. Would like it to come up and say...

"Warning, if this is a litigation file then a Main Litigation file # must be provided!"
Attached Images
File Type: jpg Form.JPG (112.6 KB, 32 views)
Reply With Quote
  #4  
Old 07-06-2017, 05:53 AM
gmayor's Avatar
gmayor gmayor is offline Drop down with warning Windows 10 Drop down with warning Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,144
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

What's the name of the litigation content control and what is the name of the litigation file number content control?
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #5  
Old 07-06-2017, 05:58 AM
pharrison pharrison is offline Drop down with warning Windows 10 Drop down with warning Office 2010 64bit
Novice
Drop down with warning
 
Join Date: Jul 2017
Posts: 12
pharrison is on a distinguished road
Default

This what you need?
Attached Images
File Type: jpg Litigation.JPG (48.2 KB, 32 views)
Reply With Quote
  #6  
Old 07-06-2017, 07:08 AM
gmayor's Avatar
gmayor gmayor is offline Drop down with warning Windows 10 Drop down with warning Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,144
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

That's fine for the litigation field - what about the number?
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #7  
Old 07-06-2017, 07:13 AM
pharrison pharrison is offline Drop down with warning Windows 10 Drop down with warning Office 2010 64bit
Novice
Drop down with warning
 
Join Date: Jul 2017
Posts: 12
pharrison is on a distinguished road
Default

Quote:
Originally Posted by gmayor View Post
That's fine for the litigation field - what about the number?
How do I get the number?

Thanks
Pete
Reply With Quote
  #8  
Old 07-06-2017, 07:16 AM
pharrison pharrison is offline Drop down with warning Windows 10 Drop down with warning Office 2010 64bit
Novice
Drop down with warning
 
Join Date: Jul 2017
Posts: 12
pharrison is on a distinguished road
Default

There is no drop down for the litigation #. That will just be put in a text field below.
If that is what you mean?

Thanks
Pete
Reply With Quote
  #9  
Old 07-06-2017, 09:20 AM
gmaxey gmaxey is offline Drop down with warning Windows 7 32bit Drop down with warning Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

You can do it using the Content Control OnExit event:

Code:
 
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Select Case ContentControl.Tag
Case "type"
If ContentControl.Range.Text = "Litigation / Litige" Then MsgBox "Some notification"
End Select
End Sub
or you can map the control to a customXMLpart and use a pseudo change event:

Code:
Private Sub Document_ContentControlBeforeStoreUpdate(ByVal ContentControl As ContentControl, Content As String)
 Select Case ContentControl.Tag
    Case "type"
      If ContentControl.Range.Text = "Litigation / Litige" Then MsgBox "Some notification"
  End Select
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #10  
Old 07-07-2017, 05:43 AM
pharrison pharrison is offline Drop down with warning Windows 10 Drop down with warning Office 2010 64bit
Novice
Drop down with warning
 
Join Date: Jul 2017
Posts: 12
pharrison is on a distinguished road
Default Tried it

I opened the doc and went into Visual Basic. Put the code in and saved it as a macro file as it forced me too. Nothing happens though when selecting litigation.


Sorry very new at this .
Reply With Quote
  #11  
Old 07-07-2017, 05:46 AM
pharrison pharrison is offline Drop down with warning Windows 10 Drop down with warning Office 2010 64bit
Novice
Drop down with warning
 
Join Date: Jul 2017
Posts: 12
pharrison is on a distinguished road
Default snapshot

Here is a snapshot
Attached Images
File Type: jpg litigation code.JPG (65.1 KB, 24 views)
Reply With Quote
  #12  
Old 07-07-2017, 06:14 AM
gmaxey gmaxey is offline Drop down with warning Windows 7 32bit Drop down with warning Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Most likely because the text of the content control is litigation / litige and not Litigation / Litige as I erroneously put in the code.
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #13  
Old 07-07-2017, 06:23 AM
pharrison pharrison is offline Drop down with warning Windows 10 Drop down with warning Office 2010 64bit
Novice
Drop down with warning
 
Join Date: Jul 2017
Posts: 12
pharrison is on a distinguished road
Default

Yeah, that's the first thing I tried still didn't go.

Pete
Reply With Quote
  #14  
Old 07-07-2017, 06:36 AM
gmaxey gmaxey is offline Drop down with warning Windows 7 32bit Drop down with warning Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Is the event firing? Is the procedure in the ThisDocument module of the project (it is a document event)? Is the CC tag "type"? Did you exit the control?
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #15  
Old 07-07-2017, 06:42 AM
pharrison pharrison is offline Drop down with warning Windows 10 Drop down with warning Office 2010 64bit
Novice
Drop down with warning
 
Join Date: Jul 2017
Posts: 12
pharrison is on a distinguished road
Default

Guessing it isn't firing as nothing happens when choosing litigation.

I did save and exit the control.

Here are some snapshots.
Attached Images
File Type: jpg lit1.JPG (47.3 KB, 20 views)
File Type: jpg lit2.JPG (44.4 KB, 20 views)
File Type: jpg lit3.JPG (32.3 KB, 20 views)
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Drop down with warning Turn off scheduling warning jjmclell Project 3 03-20-2015 07:28 AM
Drop down with warning Privacy warning. freebee2 Excel 4 06-08-2014 11:21 PM
Drop down with warning Outlook Warning Message ajazz Outlook 5 06-11-2011 04:46 AM
Problem with warning message randynovotny Outlook 1 04-20-2011 04:56 PM
Hyperlink Warning gfkbob Outlook 0 01-23-2010 06:50 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:21 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft