If there are going to be a large number of items needed on the list then you would be better placing these into a table and then set the rowsourcetype to Table/Query and then pull the information out of the table via an SQL entry in the RowSource.
To determine the number of the line use the listindex property of the list box to return the line item number, or if that is not going to be of use then consider creating a sequence number inside the sql for the recordsource and set the number of columns to be 2 with the column width being the width of the control followed by ;0cm This effectively hides the second colum from view. On the double click of the list box you can pick up the text and position like the following..
VB Code:
TextVar = lstBox1.Column(0) PosVar = lstBox1.Column(1)
For an example of creating the sequence number please have a read through this thread..
Simple Access




Reply With Quote