473,498 Members | 1,833 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to stop auto sorting in access tables

32 New Member
I have combo box includes the dates per month starting from 2009 to 2015

January 2009
February 2009
>
>
>

The table is sorted automatically by access and the months are scrambled . how I can keep the same order when I inter the data
Aug 21 '10 #1
9 12508
liimra
119 New Member
I Understand that you want to sort them in Ascending order (Jan Feb Mar..etc).

Select the combo box in design view and in its property sheet - under "Data" ---> click on the Row Source and then the built query will open . From there you can choose the sorting you want for the field/column you want. It might be very useful also to create independent query for that Combo box as it will be optimal if you want to use access on network.

why don't you just sort that column in table datasheet view and then save changes

Regards,
Ali
Aug 22 '10 #2
nebula53
32 New Member
unfortunately it’s not working , my data in the Combo Box appeared like this

January 2009
February 2009
March 2009
January 2010
February 2010
March 2010

And when I save it its get scrambled
Aug 23 '10 #3
Delerna
1,134 Recognized Expert Top Contributor
when you say scrambled is it
April 2009
April 2010
April 2011
April 2012
April 2013
April 2014
April 2015
August 2009
August 2010
...
....
etc

???

Which isn't scrambled, it is sorted alpha-numerically
Aug 23 '10 #4
nebula53
32 New Member
yes its like this
but i need it to be displayed in the same way I entered it without sorting it in this way
Aug 23 '10 #5
liimra
119 New Member
Before we move into solution, there is something imp. about programs (access, excel..). They sort information either in Alphabetical way when we talk about “text” or in Numerical way when we talk about numbers; Not to mention that dates are considered to be numbers. You are inputting dates (month and year) as text there instead of numerals and that is why Access will sort it in that way.

Anyways, here is the solution.
You just enter dates like this (Excel can fill it for you easily):
01/01/2009
01/02/2009
31/12/2009




31/12/2015

And in the date format (open table which stores the values, select datasheet - format use this without quotes “mmmm yyyy”. Finished you are done.
I have attached a database with the solution just mentioned.

More Info:
If you use (all without quotes” ”mm yyyy” then Access will read January 2010 as “01 2010” and if you use “mmm yyyy”, Access will read same date as “Jan 2010” but when you use “mmmm yyyy” Access will read it the way you want.

Regards,
Ali
Attached Files
File Type: zip month.zip (19.1 KB, 191 views)
Aug 23 '10 #6
NeoPa
32,557 Recognized Expert Moderator MVP
You need to sort the values by the dates they represent rather than the alpha representation (the strings shown).

If you need help with this then you will need to share where you are getting the data from and how you are formulating it for the control.
Aug 23 '10 #7
Delerna
1,134 Recognized Expert Top Contributor
You also need to explain this statement from your first post more fully.

The table is sorted automatically by access
It seems you are talking about the sorting in the table being scrambled, not in the combo box.
My instinct tells me that you might have the field storing your month/year string set as a key field and this might explain the alpha numeric order of the records in the table, whereas you want the records to remain in the order they were entered.

Is that correct?




I don't have a full understanding of how it works in access (my DB engine of choice nowadays is MS SQL Server) but when you make a field in a table a key field an index is automatically created for that field to help make queries run faster when you use that field in a WHERE clause.

One type of index causes the records in a table to automatically be sorted alphanumerically like in a dictionary. It is that sorting that provides the speed improvement when querying that table.

I am not sure I am on the right track for your problem here as you don't give us much detail to go on



And limra is correct, if you want dates to sort as dates then you probably should save them as dates and not strings.

You could also save them as numbers in YYYYMM format
Aug 23 '10 #8
nebula53
32 New Member
Thank you Delerna and NeoPa for your advice I really appreciate it . but Liimra solution have solved my problem.
Aug 24 '10 #9
NeoPa
32,557 Recognized Expert Moderator MVP
Thanks for posting Nebula.

I think Ali's suggestion is on pretty much the right lines and I'm not surprised it helped you resolve your problem. You should probably try to be clearer when asking questions though. It makes it easier for us to answer, and means that you get better answers (ones that fit your question more accurately), more quickly. Benefits all round.

Anyway, I'm pleased you're able to go on now :)
Aug 24 '10 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

10
5972
by: Job Lot | last post by:
Is there any way to programmatically link access tables using vb.net
5
9637
by: Santiago Ordax Solivellas | last post by:
Hi. We have almost all our tables defined on library lib1 and some on lib2. We have alias defined on lib1 to access tables on lib2 so there is no need to qualify library name. Alias for tables on...
3
23992
by: Random Person | last post by:
Does anyone know how to use VBA to relink tables between two MS Access databases? We have two databases, one with VBA code and the other with data tables. The tables are referenced by linked...
46
3786
by: Adam Turner via AccessMonster.com | last post by:
If I had a field called "Name" in an Access table "Contact Info", and the field contained VBScript... Function Main(rstFields) Main = rstFields.Item("FirstName").Value End Function 1. How do...
0
1752
by: | last post by:
I am updating MS access tables with data in an xml document. I create two dataset, one for existing data and one for new data. I fill the first dataset with the records from MS Access, the second...
1
9753
by: smaczylo | last post by:
Hello, I've recently been asked to work with Microsoft Access, and while I feel quite comfortable with Excel, I'm at a complete loss with databases. If someone could help me with this issue I'm...
2
2534
by: drek01 | last post by:
hi i am trying to import access tables into my backend database( current database) which is sql server. i created file browser which browse access database from harddrive and places all the tables...
6
6333
by: Daine | last post by:
Hi again everyone. Just trying to work out how to sort tables in VB. I have two Access queries I'm usling to append data into one table, I tried sorting each query as it was apended in the SQL...
3
5564
by: inepu | last post by:
I have some excel sheets that I would like to manage in access. I've created the access tables and relationships; the excel sheet is only one table and with duplicate data, I'd like to make sure that...
0
7208
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6890
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7379
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4915
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4593
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3095
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1423
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
657
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.