You are currently viewing the Word VBA section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
I have a Word 2007 form that I am trying to do two things with.
First, I have 11 exam site choices with text boxes. I want the user to give me the order of their top three choices of where they want to test. I want to validate it so that they can only give me choices 1-3 (in other words, not give me two #1 choices) and not allow them to choose more than 3.
Second, I need to validate the data in the formfields. If the formfield is invalid, I want to set the focus back on the formfield that is in error. Like the validation for the first item above, if they enter a '4' in the text box, I want to display a message box that tells them they can only choose up to 3 (I have this part working). I want the focus to be set back to this field so they have to try again.