When I click in listview control to send data in specific textbox then show the error.
run time error 380 Invalid property value.

I write this code:

Private Sub LVEmp_ItemClick(ByVal Item As MSComctlLib.ListItem)
With Item
       Me.txtSrNo = .Text
        Me.txtamount.Text = .SubItems(mlngCUST_LAST_IDX)
       Me.txtdate.Text = .SubItems(mlngCUST_LAST_IDX)

           End With
End Sub

Recommended Answers

All 4 Replies

I forget to declare ........

Private Const mlngCUST_LAST_IDX As Long = 1

the problem was solved. but now problem is: both text box show same data.

now I declare another one like:
Private Const mlngCUST_Date_IDX As Long = 2

problem is: both text box show same data

Of course they do. Your code

Me.txtamount.Text = .SubItems(mlngCUST_LAST_IDX)
Me.txtdate.Text   = .SubItems(mlngCUST_LAST_IDX)

is assigning the same value to both textboxes. C hange it to

Me.txtamount.Text = .SubItems(mlngCUST_LAST_IDX)
Me.txtdate.Text   = .SubItems(mlngCUST_DATE_IDX)
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.