R
Richard Horne
Hello all,
I'm trying to develop a product code generator for our stock database. The
format of our product code will be as follows:
AB-CC-DDDD-EE-FFF (all numerics)
The numbers that make up A-E are all generated from values selected in
various combo boxes on my product entry form. I've got these parts working
fine and have created a form that generate a partial product code by
concatenating all the requisite parts together.
The problem I now have is that I want to automatically generate the last
three digits (FFF) based on the number of records saved against AB-CC-DDD-EE.
Let me explain this a bit better. An example of a partial product could be
12-34-5678-91 - note FFF is missing.
And I could have multiple items with that that partial product code. FFF is
what will differentiate between them.
And while the values that can be selected for A-E are all already
predefined, F will be a freeform text box called design. So the form will
need to count how many records in the system have the partial product code
12-34-5678-91- in our given example - and then automatically assign the next
number in the sequence, or 001 if there are none.
But how do I go about doing this live count instantly on a form? The
research I've done suggests I might need to use the DMAX function but while I
can easily do this in PHP, my VBA skills are not quite upto scratch and I'm
unfamiliar with the best practises in terms of form coding.
Thanks in advance.
I'm trying to develop a product code generator for our stock database. The
format of our product code will be as follows:
AB-CC-DDDD-EE-FFF (all numerics)
The numbers that make up A-E are all generated from values selected in
various combo boxes on my product entry form. I've got these parts working
fine and have created a form that generate a partial product code by
concatenating all the requisite parts together.
The problem I now have is that I want to automatically generate the last
three digits (FFF) based on the number of records saved against AB-CC-DDD-EE.
Let me explain this a bit better. An example of a partial product could be
12-34-5678-91 - note FFF is missing.
And I could have multiple items with that that partial product code. FFF is
what will differentiate between them.
And while the values that can be selected for A-E are all already
predefined, F will be a freeform text box called design. So the form will
need to count how many records in the system have the partial product code
12-34-5678-91- in our given example - and then automatically assign the next
number in the sequence, or 001 if there are none.
But how do I go about doing this live count instantly on a form? The
research I've done suggests I might need to use the DMAX function but while I
can easily do this in PHP, my VBA skills are not quite upto scratch and I'm
unfamiliar with the best practises in terms of form coding.
Thanks in advance.