473,387 Members | 1,621 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Subform data cannot sort (ascending) according to data (from non-primary key field) f

Hi

Using MS Access 2010. Total newbie. Avoid using VBA where possible, always use the macro builders/expression builder.

I have a source table with:
ID - autonumber (primary key)
Name - text

Then I have a subform which displays multiple names from the source table. When I ask that subform sort the information, it does so according to the ID number data, not the alphabetical order of the Names data.

Many names in the source table are repeated, so I cannot use the Name field as primary.

Thanks for any guidance, it's driving me crazy =)
Sep 26 '15 #1
7 1447
hvsummer
215 128KB
Did you try to sort by name field ? if you want that name field sort by alphabetical order, you have to sort by it. And I don't think duplicate data will effect much overall. I alway sort by duplicate data since it's my classification of other data.

There're noway you could force ID field to sort that name field by alphabetical order as far as I can image.
Sep 26 '15 #2
Hi hvsummer

I did try to sort by the name field, both in the source table and then in the "record source" property of the subform (where I indicated to sort ascending by Name from the source table). But still, even though I ask to sort by Name, it seems bound to the ID number when sorting...
Sep 26 '15 #3
I found a solution, at least in my case. The primary key (autonumber) was the basis for the sort, regardless of what I asked for in my query. I have no idea why this is, but when I made the Name field = primary key, and sorted again, it worked. Of course, I am fortunate because there are no duplicate names - if there were, I'm not sure what I would do.
Sep 27 '15 #4
hvsummer
215 128KB
@GoViking: nice, if there were any duplicate names, still sort like you want row by row, don't worry.
in my database, the thing that I avoid the most is primary key, annoying function...
Sep 27 '15 #5
NeoPa
32,556 Expert Mod 16PB
I'm sorry to say that I can't agree. Nice it is not. Not unless you like problems and would like to encourage them to occur in your project.

My advice would be to go back a step or two and explain why and where your name sorting failed before you made it PK. Check the field type. The only idea I have to explain this strange behaviour is that the name may have been set as a Memo field, which would be bad news in so many ways.

NB. At this stage I should mention that making it indexed (Not unique, so duplicates must be Yes.) may well be a step forward even if making it PK certainly isn't.

I hear that you're not very experienced so we can go slowly and carefully, but I strongly advise you not to leave it as is.
Sep 27 '15 #6
hvsummer
215 128KB
@NeoPa: yeah,He should not let's it do wrong too long.

but I don't think it bring only trouble. I use my language on SQL and I have to deal with alot of trouble, and It increase my creative.
I don't think viking should follow me, but he can choose his path.

I think he should get some problem when he left it like that to collect more experience. I got a lot experience when dealing with those funny problem ==

let say in my database, query has SQL with non standard ISO, with space, and even non ACSII character like "Á, Ô, Ù" in my language.
And the result is I can't code the VBA string in VBA since VBA does not support my language's character. and what did i do, I don't stop my self and say this is enough for me, I think hardly and then it pop up in my mind.
I save SQL string with nonStandard and non ACSII in a table with ID, then call it out with Dlookup inside VBA, my problem gone.

the point is I think GoViking want make some creative too ;) and he can collect more experience upon resolving tiny problem.
Sep 28 '15 #7
NeoPa
32,556 Expert Mod 16PB
That may well be true, and congratulations to you for overcoming your problems.

However, we're not here to lead people into the wrong ways of doing things. If they manage to do that on their own, and grow due to finding a solution, then that's some benefit. Our aim here though, is to help those of you who are less experienced than we are, and guide you into sensible and database-oriented ways of doing things that will leave you - all readers - with a better understanding of the subject and better techniques with which to deal with your problems.

It's a very basic and simple concept. We're here to help people and guide them in a helpful direction.
Sep 29 '15 #8

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

Similar topics

10
by: Randell D. | last post by:
Folks, Perhaps someone can figure this out - this is 'the process of my script' I have a form whereby I can add multiple contacts to a single address. There is only one...
1
by: A.J.M. van Rijthoven | last post by:
I have a table instrumenten (INSID Instrumentname, CATID), a table Categorie (CATID, Categorydescription), Netten (NETID, description of net) and a table (kpltblinstrument) that links the...
0
by: Pavils Jurjans | last post by:
Hello, I have a third-paty application that uses text type field in MSSQL server to store data of incoming emails (full raw sources, including headers, etc.). Since the emails come in different...
6
by: abbylee26 | last post by:
Im comparing values in a field while doing a loop if sAct<>myData(5,i) then At the end of the loop I make the value of sAct equal the current myData This will work when comparing other fields...
4
by: dowlingo | last post by:
Hi, I am using Access 2000. I have a table full of records. Each record holds a value that I want to use in VBA code. Does anyone know how to take the value from the field, put it into an...
1
by: geekwagon | last post by:
Not a SQL guy but can do enough to be dangerous :) Trying to update a record. We have records that have a field with data surrounded by some comment text such as *** Previous Public Solution...
9
by: sellcraig | last post by:
Microsoft access 2 tables table "data main" contains a field called "code" table "ddw1" is created from a make table query of "data main" Goal- the data in "code" field in needs to...
9
by: RMC | last post by:
Hello, I'm looking for a way to parse/format a memo field within a report. The Access 2000 database (application) has an equipment table that holds a memo field. Within the report, the memo...
2
by: deepakjadhav | last post by:
i want to display data from textnews field in mysql within limited lines. can any one help me. the data is in textnews field at 500 lines. i want to display only 25 lines per page. please help me
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.