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
Bookmarks