List Box in MS Access

  • Thread starter Thread starter Guest
  • Start date Start date
Kent,

Just reference it, like any other control on a form:

Me.MyListbox

in the form's own module, or

Forms!MyForm!MyListbox

in any other form.

HTH,
Nikos
 
doesn't work for multiselect listboxes

Dim CurVal As Variant
Dim lb As Access.Listbox
Dim selVal As Variant

set lb = Me.MyListBox

For Each CurVal in Lb.ItemsSelected
selVal=lb.ItemData(lb.ItemsSelected(CurVal))
' Do The stuff
Next

Pieter
 
doesn't work for multiselect listboxes

Dim CurVal As Variant
Dim lb As Access.Listbox
Dim selVal As Variant

set lb = Me.MyListBox

For Each CurVal in Lb.ItemsSelected
selVal=lb.ItemData(lb.ItemsSelected(CurVal))
' Do The stuff
Next

Pieter


Kent said:
thanks Nikos! :)



--
 
I can't get your code to work. I have a multiselect listbox. I would also
like to be able to properly select a row - ie when I click on a row it
doesn't appear in reverse video - eg like if you select an email in Outlook
Express.

If I use your code I get no CurVal value - like I haven't selected anything.
There is only one row of data in my listbox and one header row.

Any ideas?

Angus



"Pieter Wijnen"
<it.isi.llegal.to.send.unsollicited.mail.wijnen.nospam.please@online.replace
..with.norway> wrote in message news:#[email protected]...
 
I had ControlSource = then I put in name of table - seemed to screw
everything up. Once I removed everything was fine.

God I thought making the move from VB to Access would be easy!!!

Angus
 
God I thought making the move from VB to Access would be easy!!!

Angus,

The two are quite different, but once you familiarize more with Access
you'll find it's much faster to develop apps with than VB.

Nikos
 

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

Back
Top