|
#1
|
|||
|
|||
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. |
#2
|
||||
|
||||
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 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.
__________________
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. |
#3
|
|||
|
|||
This is not working......... Perhaps its because i am putting into a table?
|
#4
|
||||
|
||||
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 |
#5
|
||||
|
||||
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 |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
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 |
legacy Form Field | sunrise06 | Word | 9 | 05-02-2015 06:48 PM |
Focus wonky in my legacy form fields/table | CindyHa | Word | 8 | 01-13-2015 05:37 PM |