H
haroldj
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.
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.