Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 05-08-2010, 06:02 AM
gmaxey gmaxey is offline Form Field - Drop down selection causing auto text Windows XP Form Field - Drop down selection causing auto text Office 2010 (Version 14.0)
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

First let me say that I know how much submariners love to be inspected so perhaps I shouldn't do more to make it easier on your shop .

That said, I also know that submariners don't always appreciate what is best for them so:

The first thing you need to do is to assign meaningful bookmark names to your formfields. Continuing from the previous example, lets name the checkbox VT_DIM and the text field B11_1 (That is for block 11, field 1 and perhaps not so meaningful).

You could simply create another OnExit macro specifically for the checkbox, but if this is something you want to fully exploit then you should use a single OnExit macro. Something like this:

Sub FormFieldOnExit()
Dim oFF As FormFields
Set oFF = ActiveDocument.FormFields
Dim pName As String
pName = FieldID
Select Case pName
Case "Name"
Select Case oFF(pName).Result
Case "TOPEKA"
oFF("UIC").Result = "12345"
Case "PASADENA"
oFF("UIC").Result = "54321"
Case "HELENA"
oFF("UIC").Result = "99999"
End Select
Case "VT_DIM"
Select Case oFF("VT_DIM").CheckBox.Value
Case "True"
oFF("B11_1").Result = "1C"
Case Else
oFF("B11_1").Result = ""
End Select
End Select
End Sub
Function FieldID() As String
Dim pFldName As String
If Selection.FormFields.Count = 1 Then
pFldName = Selection.FormFields(1).Name
ElseIf Selection.FormFields.Count = 0 And Selection.Bookmarks.Count > 0 Then
pFldName = Selection.Bookmarks(Selection.Bookmarks.Count).Nam e
End If
FieldID = pFldName
End Function
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Text Wrapping on Fixed Lines in a Form field/Table cell okrmjr Word Tables 0 10-30-2009 08:52 AM
Outlook 2007, contacts: drop down in custom field pacecal Outlook 0 06-16-2009 10:43 AM
Form Field - Drop down selection causing auto text Text Form Field formatting problem Toshii Word 1 06-08-2009 07:21 PM
Form Field - Drop down selection causing auto text How can I fill in form I received in email that used underlines instead of text field Gail L. Word 2 05-17-2009 12:38 PM
evaluating a text expression in a form field gwp1 Word 0 10-08-2007 02:15 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:46 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