Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-13-2015, 06:39 AM
EricMannzi EricMannzi is offline Properties for data entry control on Form help Windows 7 64bit Properties for data entry control on Form help Office 2010 64bit
Novice
Properties for data entry control on Form help
 
Join Date: Feb 2015
Posts: 7
EricMannzi is on a distinguished road
Default Properties for data entry control on Form help


I created a form using entry controls from the developer tab and was hoping I could create some validation and even tab order controls in order to, 1. control the user entries for "cleaner" information, and 2. to make sure users will fill out important information that is needed from this form. Example; I have a drop down choice control (Yes, No) box for users to select a choice and I need the control to not allow a null entry...User HAS to make a yes or no choice, or the form will cease to tab to the next form entry. Is this possible with maybe VB code or macro? The other part to this question is are there Tab order controls on a word form using fields/controls like I explained? Any help would be VERY much appreciated...thanks in advance!
Reply With Quote
  #2  
Old 02-13-2015, 07:13 AM
gmayor's Avatar
gmayor gmayor is offline Properties for data entry control on Form help Windows 7 64bit Properties for data entry control on Form help Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,105
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 of
Default

The problem with macros for this type of task is that you cannot force users to run them and so the object is somewhat defeated.

You can probably do what you want with content controls and macros (see http://gregmaxey.com/word_tip_pages/..._controls.html) , but frankly if you are going to use macros, you might as well create a userform and use that to gather the data and fill the form. That will give you far more control ... though the essential problem with macros remains. Much depends on who will be filling the forms.
__________________
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
  #3  
Old 02-13-2015, 07:47 AM
EricMannzi EricMannzi is offline Properties for data entry control on Form help Windows 7 64bit Properties for data entry control on Form help Office 2010 64bit
Novice
Properties for data entry control on Form help
 
Join Date: Feb 2015
Posts: 7
EricMannzi is on a distinguished road
Default

ok, you will have to forgive me for not knowing a lot of things and terms, so the term "userforms" you suggested...can you explain a bit about these or provide link(s) that may get me started in that direction? My main expertise has historically been in the access word, which I know very well how to handle this type of issue with data entry control...but I was hoping to handle this particular task in word based on the user needs here and not having the need for a database to store data...just achieve the document control that is being asked of me to develop this "form" for end users to be able to use.

Thanks in advance!
Eric
Reply With Quote
  #4  
Old 02-13-2015, 08:00 AM
EricMannzi EricMannzi is offline Properties for data entry control on Form help Windows 7 64bit Properties for data entry control on Form help Office 2010 64bit
Novice
Properties for data entry control on Form help
 
Join Date: Feb 2015
Posts: 7
EricMannzi is on a distinguished road
Default

ok, I see it ....VB editor....I will try to figure this out. Been a while
Reply With Quote
  #5  
Old 02-13-2015, 01:44 PM
EricMannzi EricMannzi is offline Properties for data entry control on Form help Windows 7 64bit Properties for data entry control on Form help Office 2010 64bit
Novice
Properties for data entry control on Form help
 
Join Date: Feb 2015
Posts: 7
EricMannzi is on a distinguished road
Default

hmmm....this may be a bit over my head I think. The one content control I need to have validated is a simple yes/no selection control that I need the user to answer, otherwise they will not be able to continue to tab to the next entry. So to validate the content control, which I named "ok to call Y-N" control should be the named control in the script, just not sure how to set it in the vb editor for the document. Any examples?? or can I get some help with a snipet? maybe email the document? Sorry to be a pain.

Option Explicit
Private Sub Document_ContentControlOnExit(ByVal CC As ContentControl, _
Cancel As Boolean)
Dim strTemp As String
Dim bGate1 As Boolean, bGate2 As Boolean, bGate3 As Boolean
Dim bGate4 As Boolean, bGate5 As Boolean, bValid As Boolean
Dim i As Long
Dim oRng As Word.Range
strTemp = CC.Range.Text
bValid = False
'If Application.Version < "14.0" Then Main.SetDeveloperTabActive
Select Case CC.Title
Case "ok to call Y-N"
If CC.ShowingPlaceholderText = True Or strTemp = "" Then
MsgBox "This field cannot be left blank."
'Makes CC mandatory. User can' exit until data is entered.
Cancel = True
End If
End Select
lbl_Exit:
Exit Sub
End Sub


still was able to tab through CC
Reply With Quote
  #6  
Old 02-13-2015, 05:11 PM
gmaxey gmaxey is offline Properties for data entry control on Form help Windows 7 32bit Properties for data entry control on Form help Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,429
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

Code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Select Case ContentControl.Title
  Case "ok to call Y-N"
    If ContentControl.ShowingPlaceholderText Then Cancel = True
End Select
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #7  
Old 02-20-2015, 02:14 PM
EricMannzi EricMannzi is offline Properties for data entry control on Form help Windows 7 64bit Properties for data entry control on Form help Office 2010 64bit
Novice
Properties for data entry control on Form help
 
Join Date: Feb 2015
Posts: 7
EricMannzi is on a distinguished road
Default

I inserted that code. I still can tab through it. I know it is something I am doing wrong. Sorry to bug and thanks for the help thus far.
Reply With Quote
  #8  
Old 02-20-2015, 02:21 PM
gmaxey gmaxey is offline Properties for data entry control on Form help Windows 7 32bit Properties for data entry control on Form help Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,429
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

Did you try putting as Stop in that code to see if it is running when you Exit a CC? If it is and if the CC your are trying to tab out of is titled as shown in the code, then the Cancel = True statement should keep you from being able to exit out.
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #9  
Old 02-23-2015, 09:23 AM
EricMannzi EricMannzi is offline Properties for data entry control on Form help Windows 7 64bit Properties for data entry control on Form help Office 2010 64bit
Novice
Properties for data entry control on Form help
 
Join Date: Feb 2015
Posts: 7
EricMannzi is on a distinguished road
Default

Quote:
Originally Posted by gmaxey View Post
Did you try putting as Stop in that code to see if it is running when you Exit a CC? If it is and if the CC your are trying to tab out of is titled as shown in the code, then the Cancel = True statement should keep you from being able to exit out.
ok, at this point I am thinking I am totally in the wrong place for setting this up as a macro. As I look at this, I have to press the "visual Basic" tool to see my code. Is that correct or did I set this all up in the wrong place? and yes, it is ok to call me an idiot and that I don't know what I'm doing.
Reply With Quote
  #10  
Old 02-23-2015, 10:06 PM
gmayor's Avatar
gmayor gmayor is offline Properties for data entry control on Form help Windows 7 64bit Properties for data entry control on Form help Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,105
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 of
Default

See http://www.gmayor.com/installing_macro.htm
__________________
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
  #11  
Old 02-24-2015, 09:48 AM
EricMannzi EricMannzi is offline Properties for data entry control on Form help Windows 7 64bit Properties for data entry control on Form help Office 2010 64bit
Novice
Properties for data entry control on Form help
 
Join Date: Feb 2015
Posts: 7
EricMannzi is on a distinguished road
Default

Quote:
Originally Posted by gmayor View Post

Thank you !
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Add custom doc properties in "Doc properties control" eazysnatch Word 2 09-13-2017 08:08 PM
Properties for data entry control on Form help Form field selection allows entry into form text box David C Word 1 10-24-2012 04:53 AM
Properties for data entry control on Form help User Form to Automate Entry in report Panzer Word VBA 2 08-22-2012 04:17 AM
Excel VBA: Control Word Table and Set its properties tinfanide Excel Programming 0 12-10-2011 09:06 AM
Printable Entry Form eJames Excel 1 01-07-2010 09:50 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:42 PM.


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