By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,986 Members | 1,944 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,986 IT Pros & Developers. It's quick & easy.

Validating Valid Combinations from Word Dropdowns

P: 1
I am new to VB and struggling with the following Word form problem:

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... Responsibility10. Each dropdown has VB code to generate a list a series of responsibilities 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
  1. Sub ValidateResponsibilities()
  3. If ActiveDocument.FormFields("Responsibility1").Result = "PO Requisition Approver" And ActiveDocument.FormFields("Responsibility2").Result = "Internet Procurement" Then
  4.         Do
  5.             sInFld = InputBox("PO Requisition Approver and Internet Procurement are responsibility conflicts! Choose another responsibility.")
  6.         Loop While sInFld = "Internet Procurement"
  7.         ActiveDocument.FormFields("Responsibility2").Result = "                    "
  8.        End If
Is there a better approach to validating a series of results against multiple rules?

Any help is greatly appreciated.

Sep 25 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.