set order of a table by two fields vfp
Posted on 2014-10-29
Hi: ongoing purchase order system in vfp. Now creating stocksheets and I have grouped my stock codes by type.
My stocksheets print out in group order, then listed by code number. To easily key from the completed sheets into the database I need my 'stockcount' table to mirror this exactly; sorted by type then code..
So I need to order a table by TWO fields, not one.
I have in the button on the form that populates the bare stockcount table at present:
"SET ORDER TO pkey ASCENDING"
But I need to order by field 'type' first, then pkey if possible.
Have tried "SET ORDER TO type, pkey ASCENDING"...but just knew it was going to fail.
I could run a query to create an intermediate table but what the heck; you guys are great.
And if Olaf answers, I owe you one for answering my dumb ocx question the other day.