The syntax should be
Select Case lstStores.ListIndex
Case 0: stFullName = "I:\Ops\Grocery Rescue\Jet
Reports\Rosauers\Rosa01\Rosa01.xls"
Case 1: stFullName = "I:\Ops\Grocery Rescue\Jet
Reports\Rosauers\Rosa02\Rosa02.xls"
etc..
End Select
--
HTH
Bob Phillips
(replace somewhere in email address with gmail if mailing direct)
<haroldj@shfoodbank.org> wrote in message
news:1153940624.535362.14400@b28g2000cwb.googlegroups.com...
> Hi -- This is my situation: I have a list box from which users can
> choose the report that they want to print. The code works just fine
> when I use an "If-Then-Else" construct but not so when it is
> transferred to "Select Case". Here is a snippet from both:
>
> If lstStores.ListIndex = 0 Then
> stFullName = "I:\Ops\Grocery Rescue\Jet
> Reports\Rosauers\Rosa01\Rosa01.xls"
> ElseIf lstStores.ListIndex = 1 Then
> stFullName = "I:\Ops\Grocery Rescue\Jet
> Reports\Rosauers\Rosa02\Rosa02.xls"
> ElseIf lstStores.ListIndex = 2 Then
> stFullName = "I:\Ops\Grocery Rescue\Jet
> Reports\Rosauers\Rosa03\Rosa03.xls"
> etc.
>
> Select Case stFullName
> lstStores.ListIndex = 0: stFullName = "I:\Ops\Grocery
> Rescue\Jet Reports\Rosauers\Rosa01\Rosa01.xls"
> lstStores.ListIndex = 1: stFullName = "I:\Ops\Grocery
> Rescue\Jet Reports\Rosauers\Rosa02\Rosa02.xls"
> etc..
>
> Also, I've tried this with the Value property as well as the ListIndex
> property of the ListBox object and the results are the same.
>
Bookmarks