How to make sequential number combine with string (1 Viewer)

voxy

New member
Local time
Today, 17:23
Joined
Dec 7, 2019
Messages
15
Halo, I have a question about how to make an auto sequential number combine with string.
example :

SLS/19/AA/00001
SLS/19/AA/00002
SLS/19/AA/00003
and so on

and the condition are :
SLS is default word
19 is the year
AA is the nick for the user
00001 is the number

thanks before
 

Gasman

Enthusiastic Amateur
Local time
Today, 10:23
Joined
Sep 21, 2011
Messages
14,050
You concatenate them?
Code:
P1="SLS"
P2=19
P3="AA"
P4=00001

P5=P1 & "/" & Format(P2,"00") &"/" & P3 &"/" & Format(p4,"00000")
 

voxy

New member
Local time
Today, 17:23
Joined
Dec 7, 2019
Messages
15
You concatenate them?
Code:
P1="SLS"
P2=19
P3="AA"
P4=00001

P5=P1 & "/" & Format(P2,"00") &"/" & P3 &"/" & Format(p4,"00000")

yes, my database is like this:

TableID contains ID, Name, Dept, Nick
example :

ID Name Dept Nick
1 Denny Purchasing DN
2 Victor Purchasing VC
3 Anton Purchasing AN

so If Denny use a Purchase Order Form and press add new record, the value of the PO number would be : SLS/19/DN/00001 and

If Victor add new record, the value would be : SLS/19/VC/00001

and so on
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:23
Joined
Oct 29, 2018
Messages
21,358
yes, my database is like this:

TableID contains ID, Name, Dept, Nick
example :

ID Name Dept Nick
1 Denny Purchasing DN
2 Victor Purchasing VC
3 Anton Purchasing AN

so If Denny use a Purchase Order Form and press add new record, the value of the PO number would be : SLS/19/DN/00001 and

If Victor add new record, the value would be : SLS/19/VC/00001

and so on
Hi. If your Purchase Order Form is based on your Purchases table, then your table should have a numeric PO Number field and include a separate field for the person who made the PO and the date when the PO was created/added. You would then do what Gasman said with those. You don't store the combined result anywhere in the PO table. To generate the next PO number, you can check out the link posted by June7. Cheers!
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 10:23
Joined
Sep 12, 2006
Messages
15,614
As others have said it's much better to keep all the bits separately. That way you can easily analyse the orders, without needing to break down the order number, or duplicate data that is already part of the order number.
 

Users who are viewing this thread

Top Bottom