Sorting a test field

Johnny Drama

In need of beer...
Local time
Today, 07:53
Joined
Dec 12, 2008
Messages
211
I have a sorting issue and I'm sure it'll take some code to straighten out, but I'm not a code guy.

I have a test field in my table called "Control Number". The control numbers consist of COMP1, COMP2 and so forth up to COMP14. This repeats for several other control numbers, ie ENT, CTB, TAX, and so on. I'd like to have these sorted so they show up as COMP1-14 instead of COMP1, COMP10...

Unfortunately I cannot convert the field to number because I cannot split the control identifier from the control number. Is there any way to sort these in numeric fashion?

Thanks in advance for any help.
 
You would need to split the Control Number field into two bits. One with just "COMP" in it and the other with the sequence number in it ie 1,2,3,4 etc. Provided this is a number field then it ill sort as you requre.

As the COMP field always just holds "COMP" it is unnecessary so you just need the numeric field. You can always add the "COMP" when you display the number.
 
Instead of COMP1, COMP2,COMP3, etc..., COMP10 you should save them as COMP01, COMP02,COMP03,etc...,COMP10 that way you will have them sorted correctly.
 
Rabbie,

Unfortunately I can't split them out. That would have been ideal, but I can't do it.

Drake,

Thanks...that's pretty simple and qualifies me for the "duh" award. Perfect example of trying to over complicate things...

Thanks both for your assistance
 
Rabbie,

Unfortunately I can't split them out. That would have been ideal, but I can't do it.
Of course you can. Just use a query to view your data. Most things are possible with Access
 

Users who are viewing this thread

Back
Top Bottom