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

Prevent Table from being Sorted 3

Status
Not open for further replies.
Oct 23, 2002
57
0
0
US
What I have is a table with the names of the days of the week. I can enter the names of the days of the week in the order that I wish (sun, mon, tues. to sat.) but when i close the table is automatically sorts itself my the order in the alphabet. How do I stop this or get around it ??
any suggestions???

All answers welcome.
 
Sounds like you have an index set on the day names. If you don't have an index on a table, it will display in data entry sequence. If you need an index on the day names, you could add a sequence field to the table and number them as neccessary to display correctly.

Good Luck!
 
Although SBendBuckeye is correct, there is a bit more to it than that. First and foremost is the fact that you should not be entering data through your table anyway. Access is a relational database, and it doesn't matter if the records are out of order in your perspective....

Data entry should only be performed by a user (in other words, when not processing VBA code) through a form. This prevents you screwing up the table. So, to get your days in the order you want, you can do the following....

Create a query that displays the days. Add an additional field to the end of the query. Set the Field line of this field to:

Format([name of date field], "d")

Uncheck the show box, and set the field to be sorted ascending.

Now base a form off this query. The data will now always be in the order you want it....because the Format function is converting the day name to a number and then sorting that number from 1 to whatever...You now enter all data through this form.

hope this helps....

Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. (Albert Einstein)

Robert L. Johnson III, MCP, Network+, A+
Access Developer/Programmer
robert.l.johnson.iii@citigroup.com
 
give a star to the ohio state fan (am i right), sbendbuckeye.

that was quite simple, disgustingly simple. That's what i get after a morning of meetings. yes i have a combobox based off a query based on a table. and now it works like i want it to, thanks !!!

 
sorry mastermage i didn see your post when i sent buckeye his star. You are right on all regards so i am also giving you a star for the assist to a meeting dead brain. thanks :}

 
You are correct Craftsman61 (Sound's like a Sears guy mabye?) and believe me there aren't many of us in this neck of the woods.

Have a great day!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top