Hi ChinaWolf,
No all I was doing was trying to populate 3 text fields on the same form, as a ListView control that was displaying the selected line of data (Single Select mode). I was working from an example in the Beginning
VB Databases book which on a change of selection in the ListView (ListView Click), went off to the database to retrieve the results before it populated the text fields below. What I was finding was if I permanently held down either the UP or DOWN arrow keys to change the selection, Access couldn't keep up with the database calls and displayed an 'unspecified error' message.
Because my ListView had all the necessary info for the text controls I finally managed to find the correct work around (I think).
If mylistviewctrl.SelectedItems.Count > 0
'Populate text fields
mytxtfield1 = mylistviewctrl.SelectedItems(0).Text
mytxtfield2 = mylistviewctrl.SelectedItems(0).SubItems(1).Text
mytxtfield3 = mylistviewctrl.SelectedItems(0).SubItems(2).Text
End If
It was the SubItems collection of the ListViewItem that I didn't know how to access. Everything seems to work now, and I don't get the database error message from Access. Is my code correct now?
ExDb