Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-25-2023, 12:05 PM
elsinnwell elsinnwell is offline Pre-Populated fields Windows 10 Pre-Populated fields Office 2021
Novice
Pre-Populated fields
 
Join Date: May 2023
Posts: 1
elsinnwell is on a distinguished road
Default Pre-Populated fields

I am trying to generate a form with multiple fields - with some fields to pre-populate field values, based on the value selected in another field drop down.

For example: if System = AS400, then queues impacted = NA but if System = Genesys, then queues impacted allow user to input data via a text field

Lookup Values of System will be predefined.

Please advise.

Thanks in advance...
Reply With Quote
  #2  
Old 05-28-2023, 09:43 PM
gmayor's Avatar
gmayor gmayor is offline Pre-Populated fields Windows 10 Pre-Populated fields Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,101
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

Sorry, I missed this the other day
What you propose is easy enough with content controls. You need a list box to make the selection, a rich text control for the related value and a macro to evaluate the selection(s) and fill the text control(s) appropriately.
You may find Insert Content Control Add-In useful.
The macro must go in the ThisDocument module of the form template and would be something like:
Code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Dim oCC As ContentControl
    With ContentControl
        If .ShowingPlaceholderText = False Then
            Select Case .Title
                Case Is = "System"
                    Set oCC = ActiveDocument.SelectContentControlsByTitle("Queues Impacted").Item(1)
                    Select Case .Range.Text
                        Case Is = "AS400"
                            oCC.Range.Text = "NA"
                        Case Is = "Genesys"
                            oCC.Range.Text = ""
                    End Select
                Case Else
            End Select
        End If
    End With
    Set oCC = Nothing
End Sub
The first level of case statements are your list boxes. The second the results according to the selected values.
__________________
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
Reply

Tags
form fields, word 365



Similar Threads
Thread Thread Starter Forum Replies Last Post
Check Form fields populated before save OTPM Word 12 03-10-2017 11:13 PM
copying one populated template to another caz46 PowerPoint 0 02-27-2017 05:04 AM
Naming Documents From Populated Cells TYPOGRAPHICS Word VBA 8 04-08-2016 09:13 AM
Please Help! Need auto populated last saved date. Neveradayoff Excel 0 02-05-2014 09:42 AM
Pre-Populated fields Drop-down Populated with text entry ReviTULize Word VBA 14 02-21-2013 07:06 PM

Other Forums: Access Forums

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