Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ItemsSelected Property Question

Status
Not open for further replies.

Bratfry

IS-IT--Management
Apr 10, 2001
48
0
0
US
I have an existing VBA program that populates a ListBox(A) with a query. User selects the first line in ListBox(A) and enters data into another ListBox(B). User then selects the next line in Listbox(A) and enters data into the next line in ListBox(B). Works great.

All I want to do is program the select and highlight the first line in ListBox(A) when ListBox(A) is populated by the query at the start of the program and set the focus to the first line in ListBox(B).

My code to select ListBox(A) entry number 1 is below. It does highlights the first entry fine.

formName.selected(1) = True

The coding in the program makes use of the itemsSelcted property to process the correct manual selected line. This property is not being set correctly by the above code and any other efforts I have tried to set it or reference it to the selected line have not worked. The program still works fine if I manually select the line.

What am I missing here.

Thanks for any direction guidance.

Gary
 
The ItemsSelected property is meanigfull for MultiSelect ListBox.
You may try to use the ListIndex property instead.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top