Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WHEN I ADD RECORD TO A TABLE, THE RECORDS GET ADDED RANDOMLY

Status
Not open for further replies.

arunsule

Programmer
Mar 31, 2002
6
IN
THE RECORDS GET ADDED RANDOMLY IN A TABLE
AND THE QUERY BASED ON THIS TABLE DOES NOT WORK PROPERLY AS IT CAN NOT READ LAST RECORD CORRECTLY, BECAUSE THE LAST RECORD GETS INSERTED SOMEWHERE IN TABLE AT RANDOM.
WHAT TO DO ,TO ENSURE THAT THE RECORDS GET ADDED ON 'FIRST ADDED FIRST RECORDED' BASIS
BEST REGARDS
ARUN SULE
 
Access will initially sort using the primary keys and any indexed fields. If you need to sort in the order added then you'll have to use some criteria in the data which is relevant to the order in which records were added. If this is not possible then perhaps adding a Date_Added field for sort purposes would be the simplest solution. You could use the "General Date" format and a default Value of Now(). In this way you wouldn't need to change any forms used to add data, only the queries. Sandy
 
dear sandy,
thank you for your immediate response.
i can try what you suggested.
but i am affraid because
the records can be indexed in whatever way, but the thing is that, query reads the records only in the order in which they are stored and not in order they are displayed.
can i send the table to you?
regards
arunsule
 
Arun
please do, it is much easier looking at the whole picture.

my e-mail is

sandy.sinclair@siemens.com Sandy
 
Does your table have an AutoNumber field which is the primary key for the table ?

It is possible that the NewValues setting is set to "Random"
This will cause the table to appear to 'sort' the data in a crazy way.

Alternativly - Could you add a AutoNumber field ( with NewValue set to Increment ) This will automatically give you a simple indexing field that can be reliably sorted on using the ORDER BY caluse in the query. It will also not affect the Forms or Reports design as the Autonumber field does not need to be visible.
It also protects from multiple users having System Time Clock errors that could cause problems if you use Now().


G LS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top