+ Reply to Thread
Results 1 to 4 of 4

Capture changes to User Form selections when compared to initial inputs

  1. #1
    Forum Contributor
    Join Date
    12-22-2012
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    205

    Question Capture changes to User Form selections when compared to initial inputs

    I'm trying to capture if any changes are made to a UserForms selections.

    I initially load all the data from the database when the first user form is initialized, see code below

    Please Login or Register  to view this content.
    Once I have selected the corresponing record from the combobox , in this case Planning Number, then select the command button which runs the code below

    Please Login or Register  to view this content.
    Now the user form frmProcessEngineeringTemp is opened, it now populates all the comboboxes, textboxes and option buttons in this form based on the planning number choosen from initial user form


    Please Login or Register  to view this content.
    Once the user has finished with the user form the information from the form is passed to a worksheet via a command button. If changes to the user form selections were made i need to capture what has changed (if anything), from what was initially loaded into the second user form (frmProcessEngineeringTemp).

    I have seen numerous posts from various sites that discuss Change and Exit events from a Class module and many instances where each combobox, textbox and option button is hard coded to capture changes.

    Being that I have captured my initial inputs from the database thru the myVar 1 thru 40, can this be put into a string array and the current inputs/selections in the frmProcessEngineeringTemp put into a second array then compare 1 to another looking for difference, then output the differences to a worksheet for tracking purposes. At the same time if changes were indeed made i would increment the Revison record by 1.

    I'm really not sure how to proceed, I'll be honest this is a real challange, well beyond my meager VBA skill sets, any suggestions would be greatly appreciated

    I hope i have provided sufficient information to understand what i'm looking at

    Thanks
    Last edited by jprlimey; 07-23-2014 at 04:25 PM. Reason: Solved

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Capture changes to User Form selections when compared to initial inputs

    Hi

    [ Please Note the following is untested code, here to give you a hint only.

    you are obviously populating the second userform from some worksheet data.

    something like

    Please Login or Register  to view this content.
    The same process can be used to save the updated Userform

    Please Login or Register  to view this content.

    So between the read and the save routines you need to insert a change capture routine

    Please Login or Register  to view this content.

    Now save your change Log.
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    12-22-2012
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    205

    Re: Capture changes to User Form selections when compared to initial inputs

    mehmetcik, thank you for your response, you are correct with your comments, I am populating the second user form from a worksheet.

    The 1st user form requires that i select the planning number of interest through a combo box (cbxPlanning), once selected the command button on the 1st form eventually invokes the 2nd user form to initialize, we then populate the combo boxes, text boxes and option buttons on the 2nd user form.

    Once the 2nd user form has been populated from the worksheet data, all the combo boxes, text boxes and option buttons display what was initially saved to the worksheet. The main purpose is that i want the user to see exactly what they had input previously when the planning was first created, this now permits the user to change the planning as each of the combo boxes, text boxes and options buttons are fully functional. for example all combo boxes when the drop down is opened contain all the potential choices the user can make, however it initially displays the corresponding value from the worksheet. Or if i have several option buttons within a frame the one corresponding to the worksheet data is clicked.

    Now if the user changes any of the combo boxes, option buttons or text boxes then i want to collect what changed from the initial input.

    So i'm not sure how your first code snippet and subsequent snippets will work as you refer to "Textbox", where the user form has many combinations of text boxes, combo boxes and option buttons, or am i completely missing your point in my own dumb way.

    Thanks
    Last edited by jprlimey; 07-19-2014 at 12:13 PM. Reason: word mispelled

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Capture changes to User Form selections when compared to initial inputs

    The same solution works across the board.

    Please Login or Register  to view this content.
    makes Listbox 1 = 14 which is listindex 5 in my sample userform

    so this will work for your listboxes

    Please Login or Register  to view this content.
    so this will work for your Comboxes
    Please Login or Register  to view this content.
    so this will work for your Labels
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Initial Value in a User Form that changes
    By TheSpriceEffect in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-03-2014, 10:27 AM
  2. User form to post data and charts according to user defined selections
    By siroco79 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-12-2013, 11:16 AM
  3. VBA: Create User Form That Takes Variable User Inputs
    By sanjeevpandey in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-18-2013, 06:14 PM
  4. Store and Retrieve User Inputs from Data Form
    By savio21 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-30-2011, 04:00 PM
  5. Passing inputs from one user form to another
    By daymaker in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-18-2011, 11:02 AM

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