Base table sort

Hello All,

I have a table that I would like to keep in the order I enter the data. When I save the table, Base rearranges the order by alphabetizing my primary field… I’m sure that’s a default…how do I turn that off so that my data stays in the order entered?

Thanks

Choose a integer like primary key.

Expanding on the answer by @charlie.it if you add a numeric field and then use that as the primary key with Autonumber enabled for the field, then the TABLE will automatically sort in the order by which the records are entered. You would need to manually change the sequence of integers for records already entered.

However, rarely do we look directly at data in a TABLE in normal use of a relational database. Instead, most often we construct a QUERY or VIEW that can display the table in infinitely customizable ways. A QUERY or VIEW can include a statement at the end to ORDER BY whatever field is desired for that particular application. This also is visible in the middle of the query builder columns. Thus, if you don’t like the way the TABLE looks right now, and you don’t want to ALTER the definition of the table (or if Base will not allow you to easily change the PRIMARY KEY as sometimes is the case) then you can simply create a QUERY or VIEW sorted as you desire and do not work directly with the table itself when reviewing or editing data. Likewise, any FORM or REPORT should be built on the QUERY or VIEW rather than directly on the TABLE itself.

(if this answered your question, please accept the answer by clicking the check mark (image description) to the left)

Thanks for the response…I think your last sentence is the solution…I’ve been trying to access the table directly with the forms…I guess I need to play with the query…but I was hoping I could use a form to enter new records so I’m a bit unclear as to how a query would work in populating new records…

I usually have a TIMESTAMP field at the end of rows in my databases that is automatically populated with the current date and time, which is another option for a column to sort against using a QUERY.