Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
LOCATE not functioning properly
Message
From
21/09/1999 17:57:01
 
 
To
21/09/1999 17:43:50
Ronald Suen
Epic Solutions Inc.
Edmonton, Alberta, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00267352
Message ID:
00267355
Views:
25
>Hi,
>
>I have some code that attempts to retrieve the nearest matching record using the criteria that the user enters. Unfortunately, VFP is not reacting the way I'm expecting it to.
>
>I have a three character field which is the primary key field in the table. If the user enters the first character and performs the search, it should retrieve the a record with the first character. However, what's happening instead is that it returns the last record. I'll provide an example that will better explain this:
>
>The table holds the following test data:
>CAN
>DH2
>DUH
>EUR
>PND
>RUB
>UDB
>USD
>
>
>The code that I'm using is as follows:
>
>LOCAL lnRecNo
>
>lnRecNo = RECNO("CurrMast")
>GO TOP
>SET EXACT OFF
>SEEK UPPER(ALLTRIM(THISFORM.txtCurrID.Value))
>SET EXACT ON
>
>IF NOT FOUND("CurrMast")
> GO lnRecNo IN CurrMast
> MsgBox("Currency was not found.",,,16)
> RETURN .F.
>ENDIF
>
>When I attempt to search for "D" in the textbox, the returning record is USD instead of DH2 or DUH. If I do a search for "DH" it'll still return USD. If I do a search for "DU" it'll return DUH. If I do a search for "C", it'll return CAN. What am I doing wrong?
>
>Thanks in advance,

How is the table ordered?

Is there any filters on the table?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform