CodedK
asked on
About Locate method - Very Easy. Part II
I am using the following command but the Dbgrid doesn't focus on the cells.
Form2.DataSource1.DataSet. Locate('Nu mber',Form 5.Edit2.Te xt,
[loPartialKey]);
The locate command works fine with string fields. So does locate method works for numbers ?
If not, how can i get the same result ?
Form2.DataSource1.DataSet.
[loPartialKey]);
The locate command works fine with string fields. So does locate method works for numbers ?
If not, how can i get the same result ?
Hi,
Try converting your text into a real number and use Locate on that.
HTH,
Andrew
Try converting your text into a real number and use Locate on that.
HTH,
Andrew
ASKER
I tried that. But the result is the same nothing is happening. I also sorted the dbgrid by the numbers but nopthing happened.
This is how i convert the string.
Form2.DataSource1.DataSet. Locate('NU MBER',StrT oFloat(For m5.Edit2.T ext),
[loPartialKey]);
Result is still the same.
Any ideas ?
This is how i convert the string.
Form2.DataSource1.DataSet.
[loPartialKey]);
Result is still the same.
Any ideas ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ok the code code you gave me works. :)
I will accept your answer but answer this pls.
The result with : Form2.DataSource1.DataSet. Locate('NU MBER',[Num ],[loParti alKey]);
is exactly the same with : Form2.Table1.FindKey([Form 5.Edit2.Te xt]);
The problem here is that i want Partial Key to work. It doesnt work. I have to write the whole number to go to the right cell.
Do you know why this happens? Thank you for your previous answer DeerBear. I will get back and accept your answer but pls add a comment to that if you can.
Thanks.
I will accept your answer but answer this pls.
The result with : Form2.DataSource1.DataSet.
is exactly the same with : Form2.Table1.FindKey([Form
The problem here is that i want Partial Key to work. It doesnt work. I have to write the whole number to go to the right cell.
Do you know why this happens? Thank you for your previous answer DeerBear. I will get back and accept your answer but pls add a comment to that if you can.
Thanks.
Hi,
My guess is that loPartialKey works only with variable data like strings.
I don't think you can apply it to numbers.
The help about Locate doesn't specify if it's only for strings, but that's what I
have always assumed.
HTH,
Andrew
My guess is that loPartialKey works only with variable data like strings.
I don't think you can apply it to numbers.
The help about Locate doesn't specify if it's only for strings, but that's what I
have always assumed.
HTH,
Andrew
ASKER
Is that the case ?