DS said:
Joseph said:
DS wrote:
Joseph Meehan wrote:
DS wrote:
Joseph Meehan wrote:
DS wrote:
OH BOY!!!!!!
I was afraid another can of worms would open!!!!
I have a SalesID field which is a text field. It has a DMax
ststement attached to it..... what happens is if its a Eat In
ticket then the SalesID Number is E plus the Number, If its
Delivery then its D plus the number...I might as well go on. If
its QuikServ, then its Q, Take Out is P and finaly Pick Up is
P......I'm doing this so that the SalesID
can easily be reconized on the type it is from. Any suggestions
are helpful... Thank You
DS
You can make your ID a two field ID.
Your records:
E1 E2 E4 E7 Q3 Q5 Z6
Would become
IDType IDNumber
E 1
E 2
E 4
E 7
Q 3
Q 5
Z 6
Then in a query or form you could use
IDMerg: [IDType]&[IDNumber] You could sort on number first than
type and that would give you the sort you want.
Note: the next question will be sorting
1, 2, 5, 10, 11
If you are using a number type field they will sort as above, if
you are using a text type field it will be more like
1, 10, 11, 2, 5.
Thank You. Would you suggest making it a 2 field as a opposed to a 1
field. Are there advantages to this? Is there a downside to the
other way? (The way it is now?) Any input appreciated.
DS
Well there is the advantage of being able to sort it the way you
want. It would also make it easier to select based on either type or
number part of the ID.
I would make them separate, because based on my experience it is
likely to cause less problems in the long run. However I would not
say it was wrong to do it the other way.
Thank You.....So it seems to be a matter of choice. Would the merged
field be the one to hold the real record, Since I'm using DMax...where
would it look to for the next avaiable number. The IDNumber, IDType
field...also I'm setting up for multiple users so I need to hols the
last number in one table, would that table hold the merged number?
Thanks
DS
I assume you want a consecutive number. Since Access is not going to
give you that (Auto number is sort of like that but not all the time) you
will do to code your own and I don't have any sample code for you, but it is
often posted here. Maybe a search would find it, if not you can ask a
direct question on it.
My guess is that this would be a good reason for using separate fields
for the number portion and the letter portion. It also would allow you to
do some error checking on what letter someone enters.