Go to ItemID in listbox?

  • Thread starter Thread starter bhammer
  • Start date Start date
B

bhammer

I have a single select listbox, unbound, with a query RowSource that normally
is used to select an Item and display the matching Items on a datasheet.

How can I have the form open to a specific ItemID in the listbox (where the
ItemID is given in the OpenArgs prop)?
 
I got it.
Simply set the focus, then the Value (where the bound column is the ItemID
that matches the OpenArgs)

If Not IsNull(Me.OpenArgs) Then
With Me.lstSelectDTItem
.SetFocus
.Value = Me.OpenArgs
End With
lstSelectDTItem_Click
End If

The Click event simulates the action of the user selecting the item from the
listbox, thereby running the code.
 
Back
Top