Value-Based Incrementing
Value-Based Incrementing
(OP)
I need to create a field that serializes and increments based on the value from a combo box, doesn't have to be the PK, just need a "ID" text box. Something like this that's updated when the user selects the value in the Combo:
Type ID
Phone PH00034
Phone PH00035
Email EM00017
Phone PH00036
Email EM00018
Email EM00019
Email EM00020
Thanks!!
Type ID
Phone PH00034
Phone PH00035
Email EM00017
Phone PH00036
Email EM00018
Email EM00019
Email EM00020
Thanks!!
RE: Value-Based Incrementing
If so:
CODE
Have fun.
---- Andy
A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
RE: Value-Based Incrementing
PK Type ID
1 Phone PH00034
2 Phone PH00035
3 Email EM00017
4 Phone PH00036
5 Email EM00018
6 Email EM00019
7 Email EM00020
Thanks!!
RE: Value-Based Incrementing
CODE
CODE
RE: Value-Based Incrementing
If it does not, let me know what you expect to happen.
BTW. To show your data in the post, select the data and click the icon PRE (between TT and colors) to get this:
Always use Preview to confirm before Submit.
Have fun.
---- Andy
A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
RE: Value-Based Incrementing
CODE
RE: Value-Based Incrementing
So if you pass in Phone and there is no record phone record the below will return null
maxID = DMax("ID", tblName, "Type = '" & IdType & "'")
You need to check that case, and then create the first record PH00001. That can be done with a dcount.
RE: Value-Based Incrementing
RE: Value-Based Incrementing
RE: Value-Based Incrementing
CODE
RE: Value-Based Incrementing