+ Reply to Thread
Results 1 to 4 of 4

Thread: Delete function in a userform

  1. #1
    Registered User
    Join Date
    12-28-2011
    Location
    Iceland
    MS-Off Ver
    Excel 2010
    Posts
    3

    Delete function in a userform

    I have a userform but I'm lacking one function to it which I've never done before, delete.

    It's a registry with a few columns. I have a edit function which works like this:


    Private Sub cmbName_Change()
    Dim lngNum As Long
    With cmbName
    lngNum = .List(.ListIndex, 0)
    End With
    Call ReadFromDB(lngNum + 1)
    End Sub


    The user get's a dropdown list, chooses one and the data input previously registered comes up and available for edit. What I want to do is have a simular function, expect to delete the enter row and the entire addition to the registry.

    1) At the moment I have two buttons in the sheet, Add and Edit, would it be possible to add a new button called 'Delete' just assigned to finding additions and deleting them?
    Last edited by gulli09; 01-19-2012 at 04:53 PM.

  2. #2
    Forum Guru, retired Admin royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    25,640

    Re: Delete function in a userform

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    Hope that helps.

    RoyUK
    --------
    If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need

    For Excel Tips & Solutions, free examples and tutorials why not check out my downloads

    New members please read & follow the Forum Rules

    Remember to mark your questions Solved and rate the answer(s)

  3. #3
    Registered User
    Join Date
    12-28-2011
    Location
    Iceland
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Delete function in a userform

    Done now

  4. #4
    Forum Guru, retired Admin royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    25,640

    Re: Delete function in a userform

    That's not code tags I'm afraid. The code should be prefixed with
    [ code] your code [/code]

    Note no spaces in the square brackets
    Hope that helps.

    RoyUK
    --------
    If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need

    For Excel Tips & Solutions, free examples and tutorials why not check out my downloads

    New members please read & follow the Forum Rules

    Remember to mark your questions Solved and rate the answer(s)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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.2.0