Closed Thread
Results 1 to 6 of 6

VBA: Excel form that updates current data or add new data

  1. #1
    Registered User
    Join Date
    03-21-2010
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    90

    VBA: Excel form that updates current data or add new data

    I built a form called PO Log that contains input text boxes that the user can enter the different iputs that will add an existing row to the worksheet called PO_log. I have the add function working perfectly. But I want to add a function to the form that if the record/data already exist using the PO number as an identifier, to udate the existing record/data rather than adding a completely new row of record/data. Here is the code I have below for the adding function.


    Please Login or Register  to view this content.
    Last edited by jadown; 03-21-2010 at 02:22 PM. Reason: Request to update

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: VBA: Excel form that updates current data or add new data

    Welcome to the forum.

    Please take a few minutes to read the forum rules, and then edit your post to add CODE tags.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    RSpecianJr
    Guest

    Re: VBA: Excel form that updates current data or add new data

    Hey jadown,

    Try putting this in your code:

    Please Login or Register  to view this content.
    Right above:
    'copy the data to the database
    If it finds a match for you PONumber within column B, then it will change the iRow row reference to that row. Otherwise iRow remains at the first unused row.

    Hope this helps,

    Robert Specian Jr.

    If you found this helpful please bump my reputation by clicking on the scale in the upper right hand corner of my post.

  4. #4
    Registered User
    Join Date
    03-21-2010
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    90

    Re: VBA: Excel form that updates current data or add new data

    Thanks but I want the user to be able to add data to that PO# if they need to without the Add button creating an entire new line with the same PO#

  5. #5
    Registered User
    Join Date
    03-17-2011
    Location
    Cape Town, South Africa
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: VBA: Excel form that updates current data or add new data

    Hi jadown,

    Did you find the solution to your form?

    I've got the same problem with my form, I can add records, but not updated current records.

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: VBA: Excel form that updates current data or add new data

    justinp

    Welcome to the Forum, please take the time to read the Forum Rules

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

Closed 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