hi
I've got the following problem when I use 'find' routine to locate a row in the list box.
My find routine is:
Dim intRow As Integer
Dim cntl As Control
Dim rst As DAO.Recordset
Dim sql As String
Dim intA As String
intA = InputBox("Enter PIN"
Set cntl = Me!List0
sql = "Select PIN From BlackBerryRecord Where PIN = " & intA & ""
Set rst = CurrentDb.OpenRecordset(sql, dbOpenDynaset)
If rst.NoMatch = False Then
rst.MoveFirst
For intRow = 0 To cntl.ListCount - 1
If List0.Column(1, intRow) = intA Then
List0.Selected(intRow) = True
Exit For
End If
Next intRow
End If
Set rst = Nothing
It works fine, the row gets selected...but then when user clicks on the button "VIEW" or "EDIT" to open the form for the selected record, I get an error message, because form only opens when the row is clicked, not just selected. So, I don't know what to do. Basically I have to force the user after the found row is selected to click on this row...that seems inappropriate.
Please ,if anyone has encountered this problem before. Let me know how could I resolve. How could I make my row be not only selected but clicked automatically?
Thanks
I've got the following problem when I use 'find' routine to locate a row in the list box.
My find routine is:
Dim intRow As Integer
Dim cntl As Control
Dim rst As DAO.Recordset
Dim sql As String
Dim intA As String
intA = InputBox("Enter PIN"
Set cntl = Me!List0
sql = "Select PIN From BlackBerryRecord Where PIN = " & intA & ""
Set rst = CurrentDb.OpenRecordset(sql, dbOpenDynaset)
If rst.NoMatch = False Then
rst.MoveFirst
For intRow = 0 To cntl.ListCount - 1
If List0.Column(1, intRow) = intA Then
List0.Selected(intRow) = True
Exit For
End If
Next intRow
End If
Set rst = Nothing
It works fine, the row gets selected...but then when user clicks on the button "VIEW" or "EDIT" to open the form for the selected record, I get an error message, because form only opens when the row is clicked, not just selected. So, I don't know what to do. Basically I have to force the user after the found row is selected to click on this row...that seems inappropriate.
Please ,if anyone has encountered this problem before. Let me know how could I resolve. How could I make my row be not only selected but clicked automatically?
Thanks