+ Reply to Thread
Results 1 to 7 of 7

Data Entry - Userform, override and update data instead of duplicate data.

  1. #1
    Registered User
    Join Date
    12-16-2013
    Location
    London, England
    MS-Off Ver
    MSO 2010
    Posts
    52

    Data Entry - Userform, override and update data instead of duplicate data.

    Hi all,

    I hope you Guru's can help a guy trying to help himself.

    I currently have a spreadsheet with a VB user form front end that allows staff to enter 'New' customer details when they sign up to our services, this data is automatically put into a separate sheet when they click submit, the sheet has fields such as name, telephone, stand number, etc, etc.

    When a new customer is entered it automatically enters this record below the last record in that new sheet.

    The way it current works is when they make initial contact with the customer they enter the data, then when the customer is 100% confirmed with us they enter the data again or some of their data and it also added in to the list, the only problem is i end up with duplicated data entries and i would like just the one, most recent entry per customer.

    When they enter a modification to the previous 'original' data, via the userform 'modify' or 'delete' button it is automatically put next in line in the sheet. What i would like is that instead of creating a new line of data, essentially duplicated i would like it to modify existing data linked to that stand number 'if it exists' and if not create a NEW data entry for new details. If data already exists i do not want it however to override the current data as a whole, more than just update the fields that have changed, leaving the original unchanged data the same: For Example the change might only be that the stand has got bigger, so in the modify form the user would only really enter the stand number and change the stand size.

    I hope this makes sense, i have spent lots of time working on this and i started as a VB beginner, i have uploaded a copy of what i have done and i am working on with all important data removed or changed. The sheet is protected and the password is password.

    I hope you experts can help me put the finishing touches to my project.

    Mike
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    12-16-2013
    Location
    London, England
    MS-Off Ver
    MSO 2010
    Posts
    52

    Re: Data Entry - Userform, override and update data instead of duplicate data.

    Anyone got anything?

  3. #3
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Data Entry - Userform, override and update data instead of duplicate data.

    Where to begin?

    You don't really need a userform for each action, but that's another day. A frame with radio buttons would do nicely.

    So basically in the combobox change event, you search the column for the stand number, then bring that data into the userform from the sheet.

    I store the row number where the data was retrieved from.

    After the data is updated, I use that row number in the commmandbutton event to write the record back to the same row it was pulled from.

    I had to change the initialize event a bit to make the combobox work properly.
    Attached Files Attached Files
    David
    (*) Reputation points appreciated.

  4. #4
    Registered User
    Join Date
    12-16-2013
    Location
    London, England
    MS-Off Ver
    MSO 2010
    Posts
    52

    Re: Data Entry - Userform, override and update data instead of duplicate data.

    It works,

    Thank you very much, do you have any idea how i stop the drop down box showing the blank cells with the stand numbers in?

    Mike

  5. #5
    Registered User
    Join Date
    12-16-2013
    Location
    London, England
    MS-Off Ver
    MSO 2010
    Posts
    52

    Re: Data Entry - Userform, override and update data instead of duplicate data.

    I would also like information on learning how to condense this into one form as you stated, any direction on where to start would be appreciated.

  6. #6
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Data Entry - Userform, override and update data instead of duplicate data.

    Determine the lastrow of the Column you're interested in.
    Please Login or Register  to view this content.
    Then you iterate the range and stuff the data into the combobox.

    Please Login or Register  to view this content.
    This is a brute force method. It doesn't check for duplicates. Whatever it finds in the range, it adds it.

    If the Halls, for instance, are static and don't change, then you can hard code those in.

    Please Login or Register  to view this content.
    As far as combining the userforms, add a frame and inside that frame add three optionbuttons.

    By selecting the appropriate optionbutton, you can carry out the necessary function. We can guide this selection by testing which option is selected and take the required action. We can even preselect the correct option based on the activex button that was pushed on the sheet.

    Please Login or Register  to view this content.
    Then when the Ok button is selected, we, again, test the optionbutton and perform the required action.

  7. #7
    Registered User
    Join Date
    12-16-2013
    Location
    London, England
    MS-Off Ver
    MSO 2010
    Posts
    52

    Re: Data Entry - Userform, override and update data instead of duplicate data.

    Fantastic,

    Thank you, got exactly what i needed and all working. Thanks very much.

    Mike

+ 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. Userform enter data/update data/delete data
    By msaleh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-29-2014, 12:18 PM
  2. Replies: 0
    Last Post: 02-04-2014, 12:36 AM
  3. Replies: 0
    Last Post: 05-10-2013, 08:08 AM
  4. [SOLVED] Retrieving data from sheet into userform and being able to update(replace) that data
    By crobando in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-25-2012, 09:23 AM
  5. VBA program for data entry - find the matching data to update
    By senthil.veera in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 07-19-2009, 02:47 PM

Tags for this Thread

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