Go to ItemID in listbox?

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)?
 
B

bhammer

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top