+ Reply to Thread
Results 1 to 2 of 2

Clear formfileds macro is blocking other macro to work in Word 2003Hi, I am not a VB

  1. #1
    Registered User
    Join Date
    02-24-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    1

    Clear formfileds macro is blocking other macro to work in Word 2003Hi, I am not a VB

    Hi,

    I am not a VB developer.Please explain me in simple words if any one can help me that would be of a great help to me.
    I was working on Formfields in word 2003.
    I thought of keeping a clear button to clear the fields once we fill the form.
    I have used the following codes to clear:
    -----------------------------------------------

    Private Sub ClearFields()
    ActiveDocument.Unprotect
    ActiveDocument.Protect (wdAllowOnlyFormFields)
    End Sub

    And

    Sub ClearForm()
    Dim oFld As FormFields
    Set oFld = ActiveDocument.FormFields
    For i = 1 To oFld.Count
    If oFld(i).Type = wdFieldFormDropDown Then
    oFld(i).Result = " "
    Else
    oFld(i).Result = ""
    End If
    Next
    End Sub
    ----------------------------------------------------

    But in one of the sections of the word I have recorded few macros which will change the path and navigation of the form fields.
    I want the Tab to go column wise instead of row wise in a section so I have created few macros.
    ----------------------------------------------------------------
    Eg:
    Sub Checkbox()
    '
    '

    Set addchk = ActiveDocument.FormFields("Check8").CheckBox
    If addchk.Value = True Then
    ActiveDocument.Bookmarks("Text20").Select

    End If
    End Sub
    ----------------------------------------------------------------

    The problem came when I kept the clear button.(I don,t know exactly)
    The tab was going correctly when i created the macros to go as I desired before the clear button.
    When I have placed the clear button the tab is not stopping at the Text20 formfield instead it is going to the next field i.e. Text21.

    In this way for all the macros I created ,when I press the tab the cursor is jumping from desired field to the next available field.

    Please let me know what should I do to avoid this.
    I don't know why the behavior is like this.I am not a developer either.
    Please help me.

    Thanks,
    Russel.
    Russel is offline Reply With Quote
    Last edited by VBA Noob; 02-24-2009 at 04:36 PM.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988

    Re: Clear formfileds macro is blocking other macro to work in Word 2003Hi, I am not

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1