>Is there a way to sort the field names in a table or view? I have a lot of fields I need to add to some forms and having them listed alphabetically in the ControlSource dropdown would be really nice. As it is I have to search through and hope I see the specific field I'm looking for or try to estimate where it is in the list based on the field number. I tried to do a search for a thread on this topic, but the server wouldn't respond. Thanks!
>
>Regards, Renoir
As you have seen, they are listed in the order they were created. You can sort your tables at creation using AFIELDS().
1. Create your table as you see fit.
2. Issue an AFIELDS() to create an array with the necessary information.
3. Sort the array.
4. Issue a CREATE TABLE
table name from array
array nameThis will overwrite the table already in the DBC. This works if you have nothing in the table you want to save. If you have stuff, you can create a temporary database and temporary table with the same field definitions. Append the data to the temporary table. Create the new sorted table in the main database and append back from the temporary table.
HTH.
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao