Hi,
I am trying to create a user form with multiple text boxes and checkboxes and one Combobox, this user form is used to update request for orders, from combo box user select an item and from check user can selectthe size and from textbox, user can enter the qty, till that everything is working fine. but now I have to add the edit and update button which is not working.below is the image of my form the data need to update is available in the list box by double click on the record its populate in the textbox and combo box , I am stuck in this part.
this the code I am trying to work on:Private Sub CommandButton1_Click() ' Update Data
Dim L As Long
Dim th As Worksheet
Set th = ThisWorkbook.Sheets("Data")
L = Application.WorksheetFunction.Match(CLng(Me.TextBox1.Value), th.Range("A:A"), 0)
th.Range("B" & L) = Me.ComboBoxitem.Value
th.Range("D" & L).Value = Me.CheckBoxSmall.Value
th.Range("D" & L).Value = Me.CheckBoxMedium.Value
th.Range("D" & NEXTROW).Value = Me.CheckBoxLarge.Value
th.Range("D" & L).Value = Me.CheckBoXL.Value
th.Range("D" & L).Value = Me.CheckBoXXL.Value
th.Range("D" & L).Value = Me.CheckBoXXXL.Value
th.Range("E" & L).Value = Me.txtsmallqty.Value
th.Range("E" & L).Value = Me.TextBoxmedium.Value
th.Range("E" & L).Value = Me.TextBoxlarge.Value
th.Range("E" & L).Value = Me.TextBoXL.Value
th.Range("E" & L).Value = Me.TextBoxxL.Value
th.Range("E" & L).Value = Me.TextBoxxxL.Value
Me.CheckBoxSmall.Value = False
Me.CheckBoxMedium.Value = False
Me.CheckBoXL.Value = False
Me.CheckBoXXL.Value = False
Me.CheckBoXXXL.Value = False
Me.txtsmallqty.Value = ""
Me.TextBoxmedium.Value = ""
Me.TextBoxlarge.Value = ""
Me.TextBoXL.Value = ""
Me.TextBoxxL.Value = ""
Me.TextBoxxxL.Value = ""
Me.TextBox1.Value = ""
End Sub
your kind response in this regard will be highly appreciated.
I am trying to create a user form with multiple text boxes and checkboxes and one Combobox, this user form is used to update request for orders, from combo box user select an item and from check user can selectthe size and from textbox, user can enter the qty, till that everything is working fine. but now I have to add the edit and update button which is not working.below is the image of my form the data need to update is available in the list box by double click on the record its populate in the textbox and combo box , I am stuck in this part.
this the code I am trying to work on:Private Sub CommandButton1_Click() ' Update Data
Dim L As Long
Dim th As Worksheet
Set th = ThisWorkbook.Sheets("Data")
L = Application.WorksheetFunction.Match(CLng(Me.TextBox1.Value), th.Range("A:A"), 0)
th.Range("B" & L) = Me.ComboBoxitem.Value
th.Range("D" & L).Value = Me.CheckBoxSmall.Value
th.Range("D" & L).Value = Me.CheckBoxMedium.Value
th.Range("D" & NEXTROW).Value = Me.CheckBoxLarge.Value
th.Range("D" & L).Value = Me.CheckBoXL.Value
th.Range("D" & L).Value = Me.CheckBoXXL.Value
th.Range("D" & L).Value = Me.CheckBoXXXL.Value
th.Range("E" & L).Value = Me.txtsmallqty.Value
th.Range("E" & L).Value = Me.TextBoxmedium.Value
th.Range("E" & L).Value = Me.TextBoxlarge.Value
th.Range("E" & L).Value = Me.TextBoXL.Value
th.Range("E" & L).Value = Me.TextBoxxL.Value
th.Range("E" & L).Value = Me.TextBoxxxL.Value
Me.CheckBoxSmall.Value = False
Me.CheckBoxMedium.Value = False
Me.CheckBoXL.Value = False
Me.CheckBoXXL.Value = False
Me.CheckBoXXXL.Value = False
Me.txtsmallqty.Value = ""
Me.TextBoxmedium.Value = ""
Me.TextBoxlarge.Value = ""
Me.TextBoXL.Value = ""
Me.TextBoxxL.Value = ""
Me.TextBoxxxL.Value = ""
Me.TextBox1.Value = ""
End Sub
your kind response in this regard will be highly appreciated.