的数据
我正在做一个个人项目的学习目的.我不能弄清楚为什么错误的信息得到填充在我的用户表单,当我选择编辑按钮.它迫使我重新输入信息再次编辑该行.我做错了什么,让信息填充错误的文本框?
Private Sub cmdEdit_Click()
If Selected_List = 0 Then
MsgBox "NO row is selected.", vbOKOnly + vbInformation, "Edit"
Exit Sub
End If
'Code to update the value to respective controls
Me.txtRowNumber.Value = Application.WorksheetFunction.Match(Me.lstDatabase.List(Me.lstDatabase.ListIndex, 0), _
ThisWorkbook.Sheets("Database").Range("A:A"), 0)
Me.txtJCN.Value = Me.lstDatabase.List(Me.lstDatabase.ListIndex, 1)
Me.cmbLocation.Value = Me.lstDatabase.List(Me.lstDatabase.ListIndex, 2)
Me.cmbStatus.Value = Me.lstDatabase.List(Me.lstDatabase.ListIndex, 3)
Me.txttaskname.Value = Me.lstDatabase.List(Me.lstDatabase.ListIndex, 4)
Me.txtdateopened.Value = Me.lstDatabase.List(Me.lstDatabase.ListIndex, 5)
Me.txtproblem.Value = Me.lstDatabase.List(Me.lstDatabase.ListIndex, 6)
Me.txtfixaction.Value = Me.lstDatabase.List(Me.lstDatabase.ListIndex, 8)
MsgBox "Please make the required changes and clock on 'SAVE' button to update.", vbOKOnly + vbInformation, "Edit"
End Sub
字符串
我试着重新组织me.txt来排列顺序。那不起作用。我对JavaScript代码很有经验。
1条答案
按热度按时间ffscu2ro1#
第一列为0,即
List(i,0)
字符串