Results 1 to 3 of 3

Search/update/delete records in userform

Threaded View

  1. #1
    Forum Contributor
    Join Date
    05-14-2019
    Location
    Alex, Egypt
    MS-Off Ver
    365
    Posts
    254

    Search/update/delete records in userform

    Hello Everyone

    So i am new to VBA world and i created a userform, i managed to make the form and a code to insert the data into a table "Save button" (code below)


    Private Sub CommandButton1_Click()
        'Copy input values to sheet.
        Dim lRow As Long
        Dim ws As Worksheet
        Set ws = Worksheets("DT")
        lRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
        With ws
            .Cells(lRow, 1).Value = Me.ComboBox1.Value
            .Cells(lRow, 2).Value = Me.ComboBox8.Value
            .Cells(lRow, 3).Value = Me.TextBox19.Value
            .Cells(lRow, 4).Value = Me.TextBox20.Value
            .Cells(lRow, 5).Value = Me.ComboBox3.Value
            .Cells(lRow, 6).Value = Me.ComboBox4.Value
            .Cells(lRow, 7).Value = Me.TextBox21.Value
            .Cells(lRow, 8).Value = Me.ComboBox6.Value
            .Cells(lRow, 9).Value = Me.ComboBox5.Value
            .Cells(lRow, 10).Value = Me.TextBox10.Value
            .Cells(lRow, 11).Value = Me.TextBox11.Value
            .Cells(lRow, 12).Value = Me.TextBox12.Value
            .Cells(lRow, 13).Value = Me.TextBox13.Value
            .Cells(lRow, 14).Value = Me.TextBox14.Value
            .Cells(lRow, 15).Value = Me.TextBox15.Value
            .Cells(lRow, 16).Value = Me.ComboBox7.Value
            .Cells(lRow, 17).Value = Me.TextBox22.Value
            .Cells(lRow, 18).Value = Me.TextBox18.Value
    
        End With
        'Clear input controls.
        Me.ComboBox1.Value = ""
         Me.ComboBox8.Value = ""
       Me.TextBox19.Value = ""
    Me.TextBox20.Value = ""
     Me.ComboBox3.Value = ""
        Me.ComboBox4.Value = ""
    Me.TextBox21.Value = ""
           Me.ComboBox6.Value = ""
          Me.ComboBox5.Value = ""
    Me.TextBox10.Value = ""
    Me.TextBox11.Value = ""
    Me.TextBox12.Value = ""
    Me.TextBox13.Value = ""
    Me.TextBox14.Value = ""
    Me.TextBox15.Value = ""
    Me.ComboBox7.Value = ""
          Me.TextBox22.Value = ""
    Me.TextBox18.Value = ""
    
    
    End Sub

    what i need now is to make codes to find a record by searching with "WO#" and displaying the record data to update or delete it "Update and delete" buttons.
    could you please help me, i am sorry if it sounds stupid but i tried to google it with no luck
    File attached

    update.jpg
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Delete/Update/Add/Search records in userform
    By terriertrip in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 11-15-2016, 04:20 PM
  2. Excel UserForm to browse, update, add and delete records in Access
    By takriv in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-28-2016, 11:15 AM
  3. On Userform, how to put Search, Delete, Add, Update buttons
    By TSHEPO19811 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-07-2015, 10:38 AM
  4. [SOLVED] need to be able to update records with button click and delete records sample included
    By unreal11 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-25-2013, 11:45 PM
  5. Search records from userform and update data list
    By craigw27 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-30-2013, 08:55 AM
  6. Search and Update records in database
    By Manoqs in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-20-2012, 04:25 AM
  7. Update records via UserForm
    By john55 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-26-2011, 04:04 PM

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