+ Reply to Thread
Results 1 to 2 of 2

Deleting data in userform and database

Hybrid View

  1. #1
    Jennifer
    Guest

    Deleting data in userform and database

    I found this code in the archives but it doesn't delete the data from the
    database also. If the user accidentally makes a double entry i would like
    them to be able to delete it or void it out. What would you suggest? I also
    have a few formulas in the database and when the data is erased it tends to
    mess the formulas up. Have any ideas for that also. Thank you, Jennifer
    This is what i have so far.
    With Me.ListBox1
    .RemoveItem .ListIndex
    End With

    --
    Though daily learning, I LOVE EXCEL!
    Jennifer

  2. #2
    Tom Ogilvy
    Guest

    Re: Deleting data in userform and database

    RemoveItem doesn't work if the list is bound to the data.

    Since you say it works, then you must not be bound to data.

    With Me.ListBox1
    idx = .ListIndex + 1
    .RemoveItem .ListIndex
    End With

    With Worksheets("Data")
    .Range("A1").Offset(idex,0).Entirerow.Delete
    End With

    Assumes the data starts in row1 of the sheet named data with a header row

    --
    Regards,
    Tom Ogilvy


    "Jennifer" <Jennifer@discussions.microsoft.com> wrote in message
    news:0F8A4B01-5426-432D-965C-ED6D5CD31E2D@microsoft.com...
    > I found this code in the archives but it doesn't delete the data from the
    > database also. If the user accidentally makes a double entry i would like
    > them to be able to delete it or void it out. What would you suggest? I

    also
    > have a few formulas in the database and when the data is erased it tends

    to
    > mess the formulas up. Have any ideas for that also. Thank you, Jennifer
    > This is what i have so far.
    > With Me.ListBox1
    > .RemoveItem .ListIndex
    > End With
    >
    > --
    > Though daily learning, I LOVE EXCEL!
    > Jennifer




+ 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