Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Dim x As Integer
Dim lstCount as Integer
lstCount = Me.lstItems.ListCount
'You might want to clear the all of the selected items first?
'If so, use this code to do so
For x = 0 To lstCount - 1
If Me.lstItems.Selected(x) = True Then
Me.lstItems.Selected(x) = False
End If
Next x
'End of code to clear selected items in list
For x = 0 To lstCount - 1
If Me.lstItems.ItemData(x) Like "*" & Me.txtSearch & "*" Then
Me.lstItems.Selected(x) = True
End If
Next x
Me.lstItems.ItemData(x, 1) Like ....
Dim x As Integer
Dim lstCount as Integer
lstCount = Me.lstItems.ListCount
For x = 0 To lstCount - 1
If Me.lstItems.ItemData(x) Like Me.txtSearch & "*" Then
Me.lstItems.Selected(x) = True
'Call your code that moves this item
'to the adjacent text box
'Then, since items in list are unique,
'there is no need to search the rest of the
'list, so Exit the for loop
Exit For
End If
Next x
Me.lstItems = Null
Me.txtSearch = Null
Me.txtSearch.SetFocus
Dim rst as DAO.Recordset
Dim db as DAO.Database
Set db = CurrentDb()
Set rst = db.OpenRecordset(Me.lstItems.RowSource, dbOpenSnapshot)
rst.FindFirst "[AcctNum] = " & Me.txtSearch
If Not rst.NoMatch Then
Me.lstItems = rst("AcctNum")
'Call code to move item
Else
'Do something else if item not found
End If
rst.Close
Set rst = Nothing
db.Close
Set db = Nothing