Having problems with sorting character or text fields 
Author Message
 Having problems with sorting character or text fields

The problem you are having is that Access is attempting to "alphabetize"
your numbers since the field data-type is text.  Access has no idea that
these characters have any numerical significance.

A better way to get what you want is to change the field type back to
Number and set the format property of the field to "0000".  This will force
four digits to be displayed, even if the number is less that 1000, using
leading zeros.  I think you can even do this with the auto-number field
type if you want the numbers generated for you.

Good Luck!

Darcy
Applied Microsystems, Corp.
Eden Prairie, MN  USA



Quote:
> Hi there again! I'm developing an application and all my primary keys are
> text (character) type, but what I input are numbers.  I do this because I
> want to fill with 0s to the left side of the primary key field value,
using
> the format property.

> After I enter 10 and close the form that I use for input and check the
base
> table. I see the following:
> PrimaryKeyField    DescriptionField
> 001                        Felix Melendez
> 010                        Oscar Rivera
> ...
> 009                        Ricardo Selva

> When I think that the correct way should be:
> PrimaryKeyField    DescriptionField
> 001                        Felix Melendez
> 002                        Carolina Fatima
> 003                        Gloria Batres
> ...
> 010                        Oscar Rivera
> ...
> 999                        ...

> Can somebody tell me what's going on? If you have any comments or
> suggestions, I'll be glad to read them.
> Thank in advance
> Felix Melendez
> Managua, Nicaragua



Wed, 29 Dec 1999 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. open a text file in VBScript having 500k characters in length and 5GB

2. sorting a list box from the x character of the field

3. Quote Character Ignored in Sorting Text

4. Having problems with Fields, please help.

5. Having problems binding a mask control to a date field

6. Large Text field 5000 characters

7. Eliminate Character in Text Field Help

8. Special Characters in a text field..

9. HELP, Strange characters in my text fields!

10. Still having problems with fixed text export

11. Having trouble accessing single field key with two concatenated fields

12. URGENT: Sorting Text Fields

 

 
Powered by phpBB® Forum Software