Page 1 of 4 123 ... LastLast
Results 1 to 10 of 33

Thread: doble click to modify selected record in listbox and right click to delete

  1. #1
    New Member
    Join Date
    Nov 2018
    Posts
    22
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default doble click to modify selected record in listbox and right click to delete

    hello

    i like to have help with vba codes :

    i have a listbox in userform4 i like to add a code to use right click to modify record using userform1 (userfrom1 is used to add new data to list)
    and to do right click on mouse to delete selected record from list

    please see file and original post
    http://www.excelforum.com/excel-prog...to-delete.html

    thank you

  2. #2
    Board Regular DanteAmor's Avatar
    Join Date
    Dec 2018
    Location
    México
    Posts
    6,194
    Post Thanks / Like
    Mentioned
    67 Post(s)
    Tagged
    14 Thread(s)

    Default Re: doble click to modify selected record in listbox and right click to delete

    Regards Dante Amor

  3. #3
    New Member
    Join Date
    Nov 2018
    Posts
    22
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: doble click to modify selected record in listbox and right click to delete

    thank you for share the link

    the code for me it did nothing , what i would like is to doble click on record and userform1 opens with the information in the each control to make any changes to it and save it again to table

  4. #4
    Board Regular DanteAmor's Avatar
    Join Date
    Dec 2018
    Location
    México
    Posts
    6,194
    Post Thanks / Like
    Mentioned
    67 Post(s)
    Tagged
    14 Thread(s)

    Default Re: doble click to modify selected record in listbox and right click to delete

    Quote Originally Posted by BLUEPOMME View Post
    thank you for share the link

    the code for me it did nothing , what i would like is to doble click on record and userform1 opens with the information in the each control to make any changes to it and save it again to table

    I help you with the double click. To modify the data. But I need to know all the information detail.
    - Is the data to be modified in the listbox?
    - Or do you have to get them from the sheet?
    - How did you load the data in the listbox?
    - What data goes in which control?
    - After modifying where to put the update, on the sheet or in the listbox or both?


    To delete a record, I recommend you select a record from the listbox and press a button.


    If you want me to help you with all the above, the most practical thing is that you upload your file to the cloud and explain to me with a simple example how your userform works.

    You could upload a copy of your file to a free site such www.dropbox.com. Once you do that, mark it for 'Sharing' and you will be given a link to the file that you can post here. If the workbook contains confidential information, you could replace it with generic data.
    Regards Dante Amor

  5. #5
    New Member
    Join Date
    Nov 2018
    Posts
    22
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: doble click to modify selected record in listbox and right click to delete


  6. #6
    New Member
    Join Date
    Nov 2018
    Posts
    22
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: doble click to modify selected record in listbox and right click to delete

    Hello Dante,

    and thank you to looking in to this , i hope you can open the file it is saved on google drive

    so the listbox fills from table tblEvents on sheet1 , eventos.

    doble click on a record should open userfrom1 (created to add new records to table) with the information in the controls

    for now i managed that the userform 1 opens with the selected record on doble click like this :

    Code:
    Private Sub LB_00_DblClick(ByVal Cancel As MSForms.ReturnBoolean)  With Me.LB_00
        For i = 0 To .ListCount - 1
          If .Selected(i) Then
          
            UserForm1.TextBox2.Value = .List(i, 5)
            UserForm1.ComboBox2.Value = .List(i, 4)
            UserForm1.TextBox4.Value = .List(i, 6)
            UserForm1.ComboBox3.Value = .List(i, 7)
            UserForm1.ComboBox5.Value = .List(i, 9)
            UserForm1.TextBox5.Value = .List(i, 10)
          
            
            UserForm1.Show
           
           
            
          End If
        Next
      End With
    now i still missing to add the first column the one with the date in .List(i, 0) that needs to go to the calendar in frame1 , and the time that is in column hora .List(i, 8) that goes to combobox1 (issues with time format too).

    from there you can make any modification to the record and after it , it would save it as updated record back to the table tblEvents

    on other side i agree with you too, for creating a buttom on userform4 to delete selected record .

    i hope you can acces file and understand my bad english writing

  7. #7
    Board Regular DanteAmor's Avatar
    Join Date
    Dec 2018
    Location
    México
    Posts
    6,194
    Post Thanks / Like
    Mentioned
    67 Post(s)
    Tagged
    14 Thread(s)

    Default Re: doble click to modify selected record in listbox and right click to delete

    I'm confused.
    You started the thread with the form4 now you mention the form1.
    I gladly help you with everything, but we go in parts.
    What do you want to start?
    Regards Dante Amor

  8. #8
    New Member
    Join Date
    Nov 2018
    Posts
    22
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: doble click to modify selected record in listbox and right click to delete

    ok sorry for this let me try to explain

    i use userfrom1 to add new records to table.

    i use userfrom4 to show all records on table, also i like to add a button that delete selected record from list and table.

    also i would like to do doble click on record on the listbox to modify any information/data and save it back to table for that i belived to use userfrom1 too just to update record .
    to fill userform1 i started the vba code like i posted in previous post ,(but of course if you recomend to do use other userform instead)

    at the end i would like sheet1 (EVENTOS) hidden so i can only use the userfrom to manage table (tblEvents) like an data entry form (search,add,modify,delete data) but i don´t like the Built in Data Entry Form that comes with excel

  9. #9
    Board Regular DanteAmor's Avatar
    Join Date
    Dec 2018
    Location
    México
    Posts
    6,194
    Post Thanks / Like
    Mentioned
    67 Post(s)
    Tagged
    14 Thread(s)

    Default Re: doble click to modify selected record in listbox and right click to delete

    Ok let's start with this.
    Quote Originally Posted by BLUEPOMME View Post
    i use userfrom4 to show all records on table, also i like to add a button that delete selected record from list and table.
    Is it necessary that the data in the "events" sheet be in a table? It is more complicated to work with a table.
    Is it necessary to load more than 10 columns in the listbox?
    Of all the columns there is some unique data to use as a key and thus be able to erase. If a key does not exist, then it will be necessary to create a temporary sheet.
    Regards Dante Amor

  10. #10
    New Member
    Join Date
    Nov 2018
    Posts
    22
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: doble click to modify selected record in listbox and right click to delete

    the table in sheet events is nessesary as it is used for a other sheet called calendario (deleted in uploaded file) .

    it is NOT nessesary to load columns b,c and d to listbox

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •