Hello programmers,
I have this code on a drop down box in a form. It works well if the numbers are greater or equal to 100. If I select for example a number 28 it brings up 128. Please take a look and let me know where I have gone wrong. Thanks for your assistance.
Dim rs As DAO.Recordset, okay1 As Boolean
'If IsNull(Me.txtSrch1) Then
'MsgBox "You must have a string "
'Exit Sub
'End If
Set rs = Me.RecordsetClone
rs.MoveLast
rs.MoveFirst
Do While Not rs.EOF
If IsNull(Me.txtSrch1) Then
okay1 = True
Else
okay1 = (InStr(rs![PickupID], Me.txtSrch1) > 0)
End If
If okay1 Then
Me.Bookmark = rs.Bookmark
Exit Do
End If
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
I have this code on a drop down box in a form. It works well if the numbers are greater or equal to 100. If I select for example a number 28 it brings up 128. Please take a look and let me know where I have gone wrong. Thanks for your assistance.
Dim rs As DAO.Recordset, okay1 As Boolean
'If IsNull(Me.txtSrch1) Then
'MsgBox "You must have a string "
'Exit Sub
'End If
Set rs = Me.RecordsetClone
rs.MoveLast
rs.MoveFirst
Do While Not rs.EOF
If IsNull(Me.txtSrch1) Then
okay1 = True
Else
okay1 = (InStr(rs![PickupID], Me.txtSrch1) > 0)
End If
If okay1 Then
Me.Bookmark = rs.Bookmark
Exit Do
End If
rs.MoveNext
Loop
rs.Close
Set rs = Nothing