+ Reply to Thread
Results 1 to 4 of 4

Userform to retrieve update and delete data

  1. #1
    Forum Contributor
    Join Date
    11-18-2014
    Location
    England
    MS-Off Ver
    365
    Posts
    132

    Userform to retrieve update and delete data

    I am very new to the whole userform process, I have created a basic userform to enter details but how do I make it so I can use the form to search for existing data, display it and edit it?

    I would like to use the employee id as the data that I enter and use as the basis for the search as this is the unique identifier

    I have attached my basic sheet with the userform on it on the macro under ENTER new details button

    any help would be appreciated. I have found some explanations online but they assume a lot of knowledge, this is literally the first userform I have ever created!
    Attached Files Attached Files

  2. #2
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,302

    Re: Userform to retrieve update and delete data

    try the attached, it is the basic approach that I use for most of my applications.
    you will notice I have altered your data to a 'structured table' rather than just a range list.
    structured tables are self maintaining - do not add extra blank rows at the bottom - the table will expand/contract dynamically when you add/delete data.
    you can enter new data/ update existing or remove all on the one form.
    to enter new data first press 'Clear' this ensures a clean form and activates the 'Add' button.
    fill in your data on the form and press 'Add'
    to select data for updating or deleting use the combobox dropdown the rest should be intuitive.
    all the code is in the userform module and should be more or less easily readable (to assist I have added a pdf of the code flow)
    only oddity to explain, there is a textbox embedded above the combobox kept in place by the ZOrder of each control.
    any questions post back on this site.
    Attached Files Attached Files
    Torachan,

    Mission statement; Promote the use of Tables, Outlaw the use of 'merged cells' and 'RowSource'.

  3. #3
    Forum Contributor
    Join Date
    11-18-2014
    Location
    England
    MS-Off Ver
    365
    Posts
    132

    Re: Userform to retrieve update and delete data

    torachan this is perfect thank you so much. The PDF of the code is really useful. Very much appreciated.

    You were right on my previous post that userforms are better I just hadn't got the time to learn it then due to a tight timeline but I will study this code and understand it.

    thank you again for the help.

  4. #4
    Forum Contributor
    Join Date
    11-18-2014
    Location
    England
    MS-Off Ver
    365
    Posts
    132

    Re: Userform to retrieve update and delete data

    tried to give you some reputation but as I already did on a previous post i won't allow me to again!

+ 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. Search/update/delete records in userform
    By Mahmoudelnemr in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-13-2019, 09:23 AM
  2. [SOLVED] Update/Delete data in datasheet based on userform checkboxes
    By Willem2904 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 04-05-2018, 02:25 AM
  3. [SOLVED] Delete/Update/Add/Search records in userform
    By terriertrip in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 11-15-2016, 04:20 PM
  4. On Userform, how to put Search, Delete, Add, Update buttons
    By TSHEPO19811 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-07-2015, 10:38 AM
  5. [SOLVED] userform was able to retrieve data from a workbook and then update not working
    By natks78 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-03-2015, 03:58 AM
  6. How to add, update or delete data on a Worksheet using a userform
    By AndyRoo119 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-11-2015, 03:17 AM
  7. 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

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