Hi please help me with list view functions. I also have my database. I have to pull the records out of the database and show it in the list view. I’ve already done that part. Now, here’s the scenario-I’m going to click an item or a row in the list view. The records in the list view will then be showed on the textboxes.
But the problem is an error occurred when I clicked one row in the list view. Here is the error:
Run-time error ’-2147217913 (80040e07)’;
Data type mismatch in criteria expression.
Below is my code:
CODE
Private Sub lvTariff_Click()
Dim SelectAPTariff As String
‘ClickAPTariff is a recordset
SelectAPTariff = "select * from TariffAP where FL_NO= '" & lvTariff.SelectedItem.Text & "' "
Set ClickAPTariff = myConn.Execute(SelectAPTariff)
If ClickAPTariff.EOF = False Then
txtFlightNo.Text = ClickAPTariff("FL_NO")
ClickAPTariff.MoveNext
End If
End Sub
where Set ClickAPTariff = myConn.Execute(SelectAPTariff) is highlighted when I tried to debug it.