Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Select with listbox - HELP!!!
Message
From
09/06/1998 14:22:07
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
SQL Select with listbox - HELP!!!
Miscellaneous
Thread ID:
00106414
Message ID:
00106414
Views:
62
Hello:

I'm debugging some code that displays a list of job industries into a listbox based on a certain code criteria . This is done using a CASE statement that takes the code from one table that someone has enteree and compares it to the table of codes and descriptions. The case selects codes for each level i,e, 10000000 for 1st level, 11000000 for 2nd level and so on. Everything works fine except my last level
that have codes that only have 1 zero i.e. 63321310, they display ok but won't allow me to doubleclick them to appear in my textbox as the others do. Am I missing something painfully obvious? Any help would be appreciated.




WITH thisform.List1
.BoundColumn = 2
.columncount = 2
.columnwidths = "570,0"
.ControlSource = "new_course"
.RowSourceType = 3



Do CASE
CASE val(right(new_course,7)) = 0
.RowSource = "select desc_e,code from studies ;
where right(code,7) = '0';
into cursor course1"
select course1
CASE val(right(new_course,6)) = 0
.RowSource = "select desc_e,code from studies ;
where right(code,7) = '0' ;
into cursor course1"
select course1
CASE val(right(new_course,5)) = 0
.RowSource = "select desc_e,code from studies ;
where right(code,6) = '0';
and left(new_course,1) = left(code,1)into cursor course2"
select course2
CASE val(right(new_course,4)) = 0
.RowSource = "select desc_e,code from studies ;
where right(code,5) = '0';
and left(new_course,2) = left(code,2)into cursor course3"
select course3
CASE val(right(new_course,3)) = 0
.RowSource = "select desc_e,code from studies ;
where right(code,4) = '0';
and left(new_course,3) = left(code,3)into cursor course4"
select course4
CASE val(right(new_course,2)) = 0
.RowSource = "select desc_e,code from studies ;
where right(code,3) = '0';
and left(new_course,4) = left(code,4)into cursor course5"
select course5

CASE val(right(new_course,1)) = 0
.RowSource = "select desc_e,code from studies ;
where right(code,2) = '0';
and left(new_course,5) = left(code,5) into cursor course6"
select course6

CASE val(right(new_course,1))= 0
.RowSource = "select desc_e,code from studies ;
where right(code,1) = '0';
and left(new_course,6) = left(code,6)into cursor course7"
select course7
Next
Reply
Map
View

Click here to load this message in the networking platform