Select a specific row in a listbox?

SteveBriscoe

New member
Local time
Today, 20:16
Joined
May 21, 2009
Messages
7
Hi,

I'm trying to select a row from a listbox which then changes the rowsource on another form based on the row selected, however, the first row of the listbox is always used insted of the actual row I am double-clicking on.

My code looks like this...

Dim VarItem As Variant
For Each VarItem In Me!List0.ItemsSelected
Value = List0.Column(1, RowSelected)
Forms![Search_Articles].[RecordSource] = "Select * From Articles Where article_subject = '" & Value & "'"
Next VarItem


I've searched these forums/google and tried various things but just can't get it to return anything but the first row of the listbox??

Any help would be appreciated

Thanks
 
Why are you doing: Value = List0.Column(1, RowSelected) ?? That is just wrong...

Try selecting "ItemsSelected" then hit "F1", read the access help and see the sample there.
 
Thanks, will give that a try. I'm using the value line as that's what I found on google and seemed to work, very new to VBA :)

Thanks again
 
It is not the Value that is the problem, its the rest of it... check the help and see if you can find your problem :)
 
I have, and made lots of progress thanks very much, will post the final code here once it's all working

Thanks again
 

Users who are viewing this thread

Back
Top Bottom