how do I keep the records in the order they are typed

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I created a form from a database, after typing in several record I noticed
that the order had changed I need to keep the records in the order they are
typed.

please help
 
If the order is important, you should add a field by which you can sort the
records.

Rick B
 
If you do not have an autonumber in the table structure, add one, and set it
as the primary key.
If this does not fix it. link your for to a query containing all of the
fields - sorted by the autonumber field.
"select * from table1 order by myautonumberfield"
 
I created a form from a database, after typing in several record I noticed
that the order had changed I need to keep the records in the order they are
typed.

please help

Access records are stored in no special order. If you require a
special sort order (i.e. in the order entered), you need to create a
field that indicates when the record was entered and sort on that
field.

Add a new field to your table.
Name it WhenEntered, Date/Time datatype, General Date format.

Create a query using this table as record source.
Include all the fields. Set the Sort order on the WhenEntered field.
Use this query as the form's record source.

If you wish, you can add this [WhenEntered] field to the Form.
Lock the control.

Code the Form's BeforeUpdate event:
If Me.NewRecord = True then
Me![WhenEntered] = Now
End If

Each new record will have the current date and time entered into this
field.
Note: this will only affect newly entered records, not already
existing ones. You can run an Update query on existing records to give
them a sort order before starting with entering new ones.
 
Just be aware that if you ever need to replicate the database, this won't
work, as the Autonumber field will be switched to Random.

Safer might simply be to add a Date field that defaults to Now so that
you'll know when the records were added.
 
Back
Top