Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-24-2019, 01:45 PM
SYE SYE is offline Word Legacy Form Windows 7 64bit Word Legacy Form Office 2019
Novice
Word Legacy Form
 
Join Date: Jul 2019
Posts: 2
SYE is on a distinguished road
Default Word Legacy Form

I have a two part question........ I thought I had some knowledge, but i feel like an amateur - as i have spent way to much time on this form. Please keep in mind that this form will be protected when it reaches the team members.

Part 1:

I am creating a form using the control buttons in Legacy Forms. I want to add an "If-Then Statement" to the form right next to a Form Drop Down named "QCRequirements". i would like a text to automatically populate if the answer is Yes. If Yes - Please route to John.

i have tried {IF order>=100 "Thanks" "The minimum order is 100 units"} but it just doesnt work. and i think it is because it will be a protected form.



Part 2:
In this same form, I have a separate table in excel that contains the "Department" (30 Departments and or rows) & "Department Managers" in some cases i have up to 3 managers. In the form, what i would like to happen is a table to appear that automatically generates the managers name (of a specific department), as i need to get a signature next to everyone's name. i would like the table to appear as below so they can sign in the box:

Manager's Name Manager's Signature Date Signed
Manager 1
Manager 2
Manager 3
and it would pull this info from another field named "DepartmentRequesting"

Please help me.......... and i know i may have missed some details, but i tried to be as specific as possible.
Reply With Quote
  #2  
Old 07-24-2019, 08:27 PM
gmayor's Avatar
gmayor gmayor is offline Word Legacy Form Windows 10 Word Legacy Form Office 2016
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

The first part is easy to do with legacy form fields, set the Order field property as a number field and check the calculate on exit check box. Insert the following where you require it using CTRL+F9 for the bracket pairs {}

{IF { Order } >=100 "Thanks" "The minimum order is 100 units"}. The fields will be calculated when you tab out of the order field when the form is protected.

The second part is much more complicated and requires the use of macros to unlock the form, insert the table and the fields it will contain and relock the form.

Frankly I would recommend the use of content controls rather than legacy form fields. For the first part use two text fields one titled Order and the other titled Response.
You can then use the following macro to establish which control has been filled and insert the required text

Code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Dim oCC As ContentControl
    Select Case ContentControl.Title
        Case Is = "Order"
            Set oCC = ActiveDocument.SelectContentControlsByTitle("Response").Item(1)
            If ContentControl.ShowingPlaceholderText = False And IsNumeric(ContentControl.Range.Text) = True Then
                If CInt(ContentControl.Range.Text) >= 100 Then
                    oCC.Range.Text = "Thanks"
                Else
                    oCC.Range.Text = "The minimum order is 100 units"
                End If
            Else
                oCC.Range.Text = ""
            End If
    End Select
lbl_Exit:
    Exit Sub
End Sub
You can add a further Case statement to the same macro to insert a table and further content controls as appropriate when the department is selected from a dropdown list control. You can fill that list from your Excel file.

See Insert Content Control Add-In with regard to the use of Editors and protection, converting the form to content controls and filling the list from Excel.

See attached example.
Attached Files
File Type: docm Order number Filled automatically.docm (36.9 KB, 6 views)
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com

Last edited by gmayor; 07-25-2019 at 02:03 AM.
Reply With Quote
  #3  
Old 07-25-2019, 06:16 AM
SYE SYE is offline Word Legacy Form Windows 7 64bit Word Legacy Form Office 2019
Novice
Word Legacy Form
 
Join Date: Jul 2019
Posts: 2
SYE is on a distinguished road
Default

This is not working......... Perhaps its because i am putting into a table?
Attached Files
File Type: docx INTERNAL CHANGE REQUEST.docx (139.7 KB, 7 views)
Reply With Quote
  #4  
Old 07-26-2019, 04:17 AM
gmayor's Avatar
gmayor gmayor is offline Word Legacy Form Windows 10 Word Legacy Form Office 2016
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

Apart from the facts that it has little to do with the suggestions I made and the form is not locked, what is not working?
__________________
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-26-2019, 05:16 AM
Stefan Blom's Avatar
Stefan Blom Stefan Blom is offline Word Legacy Form Windows 10 Word Legacy Form Office 2019
Moderator
 
Join Date: Aug 2011
Posts: 3,871
Stefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to all
Default

This question has been cross-posted in the Microsoft Community at Microsoft Word Legacy Forms - Microsoft Community.
__________________
Stefan Blom
Microsoft Word MVP

Microsoft 365 apps for business
Windows 11 Professional
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Word Legacy Form legacy form fields conditional statements steelcity79 Word 3 05-05-2018 04:02 AM
Can legacy form check boxes work if document is NOT protected? snowboarder2 Word 1 09-08-2016 03:53 AM
Legacy Form Fields Miscalculate LauraL Word 2 09-21-2015 08:47 PM
Word Legacy Form legacy Form Field sunrise06 Word 9 05-02-2015 06:48 PM
Word Legacy Form Focus wonky in my legacy form fields/table CindyHa Word 8 01-13-2015 05:37 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:19 AM.


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