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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Listbox control

Status
Not open for further replies.

deulyd

Programmer
Oct 17, 2001
106
CA
Hi,
I'm currently using a listbox control in an access form to display some information. But I do not find the way to select a specific row in the code. The "selected" property changese the position in the listbox but doesn't modify it's value.
------------------------------------
example:

' let's say row 3 is selected

me.list1.selected(5) = true
' this will change the highlight in the form

msgbox me.list1
' value is still #3

------------------------------------

Please help me

thanks
 
' let's say row 3 is selected

me.list1.selected(5) = true
' this will change the highlight in the form

'msgbox me.list1 'change to
msgbox me.list1.ItemData(5)'?


 
I just pulled this code from one of my projects - it works just fine:
Code:
    Set dlg = New CAPPCalcsDialog
    dlg.CAPPcodes.Selected(1) = True
    dlg.CAPPcodes.Selected(3) = True
    dlg.CAPPcodes.Selected(5) = True
    dlg.Show
CAPPcodes here is a listbox control. But I have (obviously) multiselect = true, so I have to process the userform using the Selected property anyway, can't use the default property.
Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top