Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Record help, need specific, its finding closest

Status
Not open for further replies.

lashwarj

IS-IT--Management
Nov 1, 2000
1,067
US
Below is my code, it returns record similiar its not exact. How do i make my results exact. EX. If I put in 301.13-1-33 it will give me 301.13-1-3 and due to my not having a record select this will not be acceptable.


LOCAL cValue
STORE ALLTRIM(ThisForm.Text1.Value) to cValue
LOCATE FOR cValue = ALLTRIM(parcelid)
GOTO TOP
IF !FOUND()
GO TOP
LOCATE FOR cValue = ALLTRIM(newkey)
IF !FOUND()
MESSAGEBOX("Tax Map # Not Found","Sorry")
STORE "" TO ThisForm.Text1.Value
ENDIF
ENDIF
ThisForm.Text2.Value = parcelid
ThisForm.Text3.Value = newkey
THISFORM.REFRESH()
 
The alltrim didnt help, how do I do the exaclty like
 
lashwarj

You may want to add (In the init of your form)
SET EXACT ON
SET NEAR OFF
 
I recommend that you not use locate but use seek instead. With large numbers of records, locate takes a looooong time. It looks at each and every record, while seek jumps to the record.
 
More of my 2 cents.

lashwarj: The double equal (==) in weedz's statement is the exact match, as opposed to te single equal(=).

Racoon: LOCATE FOR is rushmore-able. It can be as fast as SEEK if there is an index usable by the rushmore technology.

Dave S.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top