Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Jul 2010
    Location
    Land of Enchantment, USA
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi all -

    I have a VBA procedure in a Word 2003 form with a For/Next loop that can be run through a maximum of 7 times. At one point, I use a MacroButton to pull up a userform that requests 3 bits of data from some combination of 3 cascading comboboxes or 3 textboxes. I refer to the 3 bits of data collectively as a Category/Type/Item, or CTI for short. Back on my form, I have a table with 18 formfield textboxes that will allow for the entry of up to 6 CTIs.

    The formfield textboxes in the form are named as follows:
    cti1txtCat1, cti1txtType1, cti1txtItem1
    cti1txtCat2, cti1txtType2, cti1txtItem2
    ...
    cti1txtCat6, cti1txtType6, cti1txtItem6

    where the "1" after "cti" means the 1st question in the CTI section.

    So in the code for my Add CTI button back on the userform, I have this:
    _____________________________
    Dim ffCat As FormField
    Dim ffType As FormField
    Dim ffItem As FormField
    Dim j As Integer
    [Code to validate CTI entry]
    For j = 1 - 7

    ffCat.Name = "cti1txtCat" & j
    ffType.Name = "cti1txtType" & j
    ffItem.Name = "cti1txtItem" & j
    ffItemKW.Name = "cti2txtItem" & j

  2. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    New Lounger
    Join Date
    Jul 2010
    Location
    Land of Enchantment, USA
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    As I wrote the above post, I figured out the solution - I changed my ffCat, ffType, and ffItem variables to strings - strCatName, strTypeName, strItemName and got it from there. I can't remember actually posting this.

    Sorry!

    Kerennya

Posting Permissions

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