Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Unique Records
Message
From
02/07/2003 04:32:16
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00805977
Message ID:
00805978
Views:
34
>I have a program which consists of a form with an edit box and list box and a command button. When I enter a number in the edit box it will search the content of the table and return the design number. It acts as a where used scenario. For example if I search on the number 000737 it will give me the results:
>
>T59*SS2003*JKT400*TECHNICAL
>T59*SS2003*JKT400*TECHNICAL
>T57*SS2003*SK167*SAMPLE
>T56*AW2004*BC159*SAMPLE
>
>The reason why there are 2 records the same is because that number appears twice under that design number. How can I change my code below to show only occurence of each record:
>
>T59*SS2003*JKT400*TECHNICAL
>T57*SS2003*SK167*SAMPLE
>T56*AW2004*BC159*SAMPLE
>
>Here is my code:
>
>SET EXCLUSIVE OFF
>SET DELETED ON
>
>SELECT article.articleno, specific.articleno, specific.mainkey ;
>FROM ("U:\Data\article"), ("U:\Data\specific") ;
>WHERE thisform.text1.Value=article.articleno AND article.articleno=specific.articleno ;
>INTO CURSOR temp
>
>WITH thisform.list1
> .RowSourceType = 3
> .RowSource = 'Select mainkey from temp into cursor result'
> .ColumnCount = 1
>ENDWITH
>
>IF EMPTY(temp.articleno_a)
> MESSAGEBOX("No records have been found",048,"Articles Where Used Alert Manager")
>ELSE
>ENDIF
>
>Many Thanks

Neil,

Can you change your 1st select into
SELECT distinct specific.mainkey ;
  FROM ("U:\Data\article"), ("U:\Data\specific") ;
  WHERE (thisform.text1.Value=article.articleno) AND (article.articleno=specific.articleno) ;
INTO CURSOR temp
Gregory
Previous
Reply
Map
View

Click here to load this message in the networking platform