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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

auto number 2

Status
Not open for further replies.

timhans

Programmer
Jun 24, 2009
75
Hello. I have a form with a underlying table, the table has a date field, and an auto number field(other as well).I need the table sorted on the date field earliest date to most recent and I need the autonumber field to be in sympathy with this so.. date1 auto1, date2 auto2 ect...,I have tried deleting the auto field then sorting on the date field then recreating the auto field but no luck, the auto field scrambles the date field. Am fairly new to access, any help is appreciated, thanks. Also I am not a programmer just a tech user, cant figure out how to change that.
 
I think this would probably be the best method on your issue:

[ol][li]Copy your table (structure only) to a new table - give it some other name - you can always rename the new table later.[/li]
[li]Make sure the field formats carried accross in the copy - for instance, your date field is still date, your autonumber field is still autonumber.[/li]
[li]Create an Append Query that takes all the fields (except your autonumber field) and inserts them into your new table.[/li]
[li]With your new query, sort that query by the Date column in the query definition (design view).[/li]
[li]Run the query, telling Access that yes you want to append these records..[/li]
[li]Now your data should be in the correct order in the new table.[/li]
[li]Once you've verified the data in the new table is correct, delete the old table, and rename the new table to the old name (if the table name was important).[/li]
[/ol]

And for future reference, this would have been more of a table issue than a form issue, since it's the table data, not something on the form. For future reference, try to post your question(s) in the most likely forum.

In case you've not done so, it would also be a good idea to take a look at:

faq219-2884

and

faq181-2886

--

"If to err is human, then I must be some kind of human!" -Me
 
AutoNumber works well when the number has no significance. An AutoNumber usually serves as your primary key. Adding another function in meaning is counter-productive.

Reference the data through a query and sort by the date..

[purple]If we knew what it was we were doing, it would not be called
research [blue]database development[/blue], would it? [tab]-- Albert Einstein[/purple]​
 
kjv1611, I have followed yor advice, thank you, did not mean to post in wrong location, though not always clear were form ends and table begins.
 
It's great you got your challenge resolved. The link "Thank kjv1611 for this valuable post" is a good way for you to acknowledge his help!

[purple]If we knew what it was we were doing, it would not be called
research [blue]database development[/blue], would it? [tab]-- Albert Einstein[/purple]​
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top