I am designing a Word form whereby the collective values from 10 different dropdowns must be tested to ensure that any 2 combinations is valid against a set of established rules.
For example; there are 10 dropdowns called Responsibility1 , Responsibility2 ... Responsibility1 0. Each dropdown has VB code to generate a list a series of responsibilitie s based on a selection made in the Org_Type field (using the Select Case Statement).
Some combinations from Responsibility1 ...10 are not allowed. I have a word table with 2 columns, 1 listing each responsibility and a second column identifying its related conflict. If any combination from Responsibility1 ...10 matches the conflict table then an input box should will appear stating the conflict - looping until the user corrects a selection not in conflict.
Here is an example of the conflict table;
Responsibility NotAllowedWith
Internet Procurement PO Requisition Approver
GL Journal Entry Budget Approver
GL Journal Entry Budget Entry
GL Journal Entry PO Requisition Approver
AP Approver AP Invoice Entry
Currently I am using the IF statement to evaluate conflicts but it seems like a very cumbersome approach. E.g.
Expand|Select|Wrap|Line Numbers
- Sub ValidateResponsibilities()
- If ActiveDocument.FormFields("Responsibility1").Result = "PO Requisition Approver" And ActiveDocument.FormFields("Responsibility2").Result = "Internet Procurement" Then
- Do
- sInFld = InputBox("PO Requisition Approver and Internet Procurement are responsibility conflicts! Choose another responsibility.")
- Loop While sInFld = "Internet Procurement"
- ActiveDocument.FormFields("Responsibility2").Result = " "
- End If
Any help is greatly appreciated.
GOgier