+ Reply to Thread
Results 1 to 6 of 6

Editing data with userforms

  1. #1
    Registered User
    Join Date
    01-26-2009
    Location
    United Staes, Michigan
    MS-Off Ver
    Excel 2003
    Posts
    10

    Editing data with userforms

    I have an inventory ws I am trying to put together and I am just learning how to use userforms. So far I am able to enter new items into my database using the userform I created, but I cant edit items that already exist.

    I've attached a copy of my work in progress populated with a few sample items.

    What I would like to be able to do is have my userform recognize when an item is already in the database (for example AAA) and then instead of inserting another instance of that item, have the userform either add to the quantity or subtract (if quantity in userform is neg).

    I would also like the userform to update location. For example if a new shipment of AAA comes in and is stored in Loc 8 (whereas the old AAA is stored in Loc 5) I would like the database to display "Multiple" in the location cell for AAA.

    I appreciate any help anyone can give a beginner like me.
    Thank You
    Attached Files Attached Files

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Editing data with userforms

    Hello EDUcoordGR,

    I modified your code to update the data and also select it on the worksheet, so the user can see what is being edited. I removed the item text box and replaced it with a ComboBox. This enables the product name to be stored along with its cell address on the worksheet. This makes referencing the worksheet much easier and faster since the product address can be retrieved from the control that selects the product. Here is the revamped code. It has already been added to the attached workbook.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    01-26-2009
    Location
    United Staes, Michigan
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Editing data with userforms

    That's great. I was actually trying to use a combo box myself, but I couldn't quite figure out how to use it. The only other thing is that I would like to be able to add or subract from a total product quantity via the userform.

    For example if FFF is already in the database with 160 units and I want to edit the database because I used 25 units I would like to be able to use the userform and put -25 in the quantity section and have it update to 135 instead of saying -25. Or if 25 more units of FFF came in I would like to be able to add those 25 units to the total.

    Thanks

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Editing data with userforms

    Hello EDUcoordGR,

    There would be less likely hood for errors if you use Add and Substract buttons for the quantity. I can add those in if you want.

  5. #5
    Registered User
    Join Date
    01-26-2009
    Location
    United Staes, Michigan
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Editing data with userforms

    I would love to see how it would look with add and subtract buttons.

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Editing data with userforms

    Hello EDUcoordGR,

    Here is the update version with the Add and Subtract buttons added. I also added some icons to buttons.
    Attached Files Attached Files

+ 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