>Hello All:
> In my application, data is displayed in a grid. The table is created with vfpxtab.prg. I also use alter table to add 2 fields to the table. I am wondering if I can re-arrange the field orders for that table before it is displayed ?? thanks.
Rather than that, why not just alter the control sources for the columns to fit the actual order of the fields to use in the grid?
Alternatively, create a second table or cursor with the two added fields in the correct order and use APPEND FROM to fill it with the results from the crosstab, rather than using ALTER TABLE.
Or use a SQL SELECT against the result of the xtab adding the fields in your SELECT statement in the right place.
Lots of ways to do this; which is best will depend on your situation. SQL SELECT lets you fill the added fields with values other than the field type default; APPEND FROM will let you use a writable cursor for your results, and specifying the columns programmatically rather than by the field order allows you to manage detailed order of presentation and data source (it can be used in conjunction with the other approaches as well.)