A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Go to ItemID in listbox?



 
 
Thread Tools Display Modes
  #1  
Old September 17th, 2009, 12:51 AM posted to microsoft.public.access.forms
bhammer
external usenet poster
 
Posts: 54
Default Go to ItemID in listbox?

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)?
  #2  
Old September 17th, 2009, 01:20 AM posted to microsoft.public.access.forms
bhammer
external usenet poster
 
Posts: 54
Default Go to ItemID in listbox?

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.
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:52 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.