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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

locate doesnt work

Status
Not open for further replies.

filipe29

Programmer
Jan 14, 2006
23
PT
Hi .I have a locate to a query like this:
if vendas_em_divida.Locate('IDVenda',qry_vendasidvenda.Value,[])=true then
showmessage(vendas_em_dividaidvenda.AsString);

and for some reason the message is not displayed.The sintax is correct and i have in vendas_em_divida the value (qry_vendasidvenda.Value)

why doesnt locate??

My database is sql server with ADO querys
 
I dont know what qry_vendasidvenda.Value is returning or what it is at all, but try using the target value directly.

Like in:

Code:
Target := value_to_search;
if vendas_em_divida.Locate('IDVenda', Target, []) then ...

Eventually, using:

Code:
Target := qry_vendasidvenda.Value;
if vendas_em_divida.Locate('IDVenda', Target, []) then ...

will let you set a breakpoint and check Target.

HTH.
buho (A).
 
Just a tip... always do a First before a locate to make sure you start at the beginning.

vendas_em_divida.First;
vendas_em_divida.locate...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top