Results 1 to 5 of 5
  1. #1
    4 Star Lounger
    Join Date
    Apr 2002
    Location
    Northern Territory, Australia
    Posts
    471
    Thanks
    16
    Thanked 0 Times in 0 Posts

    User Form not working (Word 2003)

    I dont give up easily. I have spent two nights working on this document and cannot resolve my problem.

    I have been using this type of form for ages. I decided to add another field (FAX), and once I do that the userform wont open. I have no idea why.

    I have attached the document with a stripped down version of the document. Using Alt F you will see the variables.

    Help would be appreciated.
    Attached Files Attached Files

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: User Form not working (Word 2003)

    The document variable varFax has not been created or has been deleted. If you create it manually by typing the following in the Immediate window

    ActiveDocument.Variables("varFax") = "Fax "

    and pressing Enter, the form will work again.

  3. #3
    4 Star Lounger
    Join Date
    Apr 2002
    Location
    Northern Territory, Australia
    Posts
    471
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Re: User Form not working (Word 2003)

    Thanks Hans. Ofcourse your solution worked!

    I have never used the Immediate window before. Can you briefly tell me why that worked?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: User Form not working (Word 2003)

    The form wouldn't open because the Form_Initialize procedure calls ReseedForm, and this procedure has a line

    tbxFax = Trim(.Variables("varFax").Value)

    This caused an error since the varFax variable was not defined. The Immediate window is extremely useful - it lets you execute code without writing a complete Sub or Function. Just type an instruction and press Enter. The line I posted defines the varFax variable by assigning a value to it.

  5. #5
    4 Star Lounger
    Join Date
    Apr 2002
    Location
    Northern Territory, Australia
    Posts
    471
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Re: User Form not working (Word 2003)

    Got it! If I had simply read that somewhere it wouldnt have sunk in. When it is relative to a problem I am having I remember.

    I always learn something new at the Lounge. Thanks again Hans.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •