Hi Andrew,
Hmmmm... I see, so if the Index doesn't exist ( as in the case of JobFunctionId which is really JobFunctio ) the value of JobFunctionId in the current record is taken and used as the order number. It's pretty obvious really, but at the time I was dumbfounded as to why this was happening.
Thanks,
Gavin...
>Hi Gavin,
>
>The problem is that JobFunctionID evaluates to 1, so essentially, you're issuing a SET ORDER TO 1.
>
>If you type
GO 3
>SET ORDER TO jobfunctionid
You'll get the expected error message.
>
>Cheers,
>
>Andrew
>
>
>
>
>>Hi All,
>>
>> I've come across a very strange problem with SET ORDER TO in VFP6.0. Can someone try the following step of events and see if they encounter the problem:
>>
>>CREATE DATABASE thisisatest
>>CREATE TABLE jobfunctions ( jobfunctionid N(10), description N(50) )
>>
>>BROWSE the table and enter these three records
>>
>>1,Z
>>2,G
>>3,A
>>
>>Type SET in the command window, then click PROPERTIES, MODIFY, then click on the index column in the Fields Tab and set both fields to have ascending indexes. Click OK, OK and close the SET window.
>>
>>Now type SET ORDER TO jobfunctionid. You'll notice that the order is now set to the DESCRIPTION index. I know that index names can only be 10 characters in length so shouldn't setting the order to jobfunctionid cause an error because jobfunctionid is not an index? Am I going crazy here? I've just spent about 2 hours trying to find why a Grid on form is displaying in the wrong order.
>>
>>Thanks,
>>Gavin...