mehranmahouti
New Member
- Joined
- Oct 2, 2021
- Messages
- 7
- Office Version
- 2019
- Platform
- Windows
Hi,
I have a form like this image and in its database, some Cell has Comment in them.
What I want is, when I select a user from the form, the comment of each cell appears in a specific textbox (because there is more than one cell in a row that can have a comment), so each cell's comment should appear in its specified textbox (if there are any comments).
Also if I add or change any text in that textbox the text should appear as a comment on that cell.
How can I do that with the codes in this form?
These are the codes from Edit buttons Click event:
I have a form like this image and in its database, some Cell has Comment in them.
What I want is, when I select a user from the form, the comment of each cell appears in a specific textbox (because there is more than one cell in a row that can have a comment), so each cell's comment should appear in its specified textbox (if there are any comments).
Also if I add or change any text in that textbox the text should appear as a comment on that cell.
How can I do that with the codes in this form?
These are the codes from Edit buttons Click event:
VBA Code:
Private Sub cmdEdit_Click()
If Selected_List = 0 Then
MsgBox "Herhangi bir satır seçilmedi.", vbOKOnly + vbInformation, "Edit"
Exit Sub
End If
'Code to update the value to respective controls
Dim sGender As String
Dim pBacak As String
Me.txtRowNumber.Value = Application.WorksheetFunction.Match(Me.lstDatabase.List(Me.lstDatabase.ListIndex, 0), _
ThisWorkbook.Sheets("Database").Range("A:A"), 0)
Me.txtID.Value = Me.lstDatabase.List(Me.lstDatabase.ListIndex, 1)
Me.txtName.Value = Me.lstDatabase.List(Me.lstDatabase.ListIndex, 2)
sGender = Me.lstDatabase.List(Me.lstDatabase.ListIndex, 3)
If sGender = "KADIN" Then
Me.optFemale.Value = True
Else
Me.optMale.Value = True
End If
Me.txtPaketSayisi.Value = Me.lstDatabase.List(Me.lstDatabase.ListIndex, 5)
Me.txtAdres.Value = Me.lstDatabase.List(Me.lstDatabase.ListIndex, 6)
Me.txtTel.Value = Me.lstDatabase.List(Me.lstDatabase.ListIndex, 7)
Me.txtTC.Value = Me.lstDatabase.List(Me.lstDatabase.ListIndex, 8)
Me.txtYas.Value = Me.lstDatabase.List(Me.lstDatabase.ListIndex, 9)
Me.txtMeslek.Value = Me.lstDatabase.List(Me.lstDatabase.ListIndex, 10)
Me.txtFiyat.Value = Me.lstDatabase.List(Me.lstDatabase.ListIndex, 11)
Me.txtBorc.Value = Me.lstDatabase.List(Me.lstDatabase.ListIndex, 12)
Me.txtToplamSeans.Value = Me.lstDatabase.List(Me.lstDatabase.ListIndex, 13)
Me.txtBacakSafa.Value = Me.lstDatabase.List(Me.lstDatabase.ListIndex, 14)
Me.txtGenitalSafa.Value = Me.lstDatabase.List(Me.lstDatabase.ListIndex, 16)
...
..
.
End Sub