D
Debra Ann
MS Access 2003 question:
I have a numbering system on a form made up of five fields in a table. The
user picks from combo boxes the first four fields and then he will click on a
command button that will need to create the sequence number in the fifth
field.
The number filled in needs to be the next consecutive number in the table
depending on the uniqueness of the first four-field combination.
If the four-field combination does not exist in the table yet, the first
number given is 50001.
If it does exist, then it needs to take the last sequence number of that
four-field combination and add "1" to it.
For example, the table has the following numbers already:
AAA-BBB-CCC-DDD-50001
NNN-OOO-PPP-QQQ-50001
AAA-BBB-CCC-DDD-50002
AAA-BBB-CCC-DDD-50003
NNN-OOO-PPP-QQQ-50002
If I was to create a new record with the combination of AAA-BBB-CCC-DDD,
then the sequence number would need to be 50004.
However, if I create a new record with a new combination (FFF-GGG-HHH-III,
then the sequence number would need to be 50001 again.
I have no earthly idea how to query the table behind the scenes of a form to
find out what number to assign to the sequence field.
Guidance would be greatly appreciated.
Thank you,
Debra Ann
I have a numbering system on a form made up of five fields in a table. The
user picks from combo boxes the first four fields and then he will click on a
command button that will need to create the sequence number in the fifth
field.
The number filled in needs to be the next consecutive number in the table
depending on the uniqueness of the first four-field combination.
If the four-field combination does not exist in the table yet, the first
number given is 50001.
If it does exist, then it needs to take the last sequence number of that
four-field combination and add "1" to it.
For example, the table has the following numbers already:
AAA-BBB-CCC-DDD-50001
NNN-OOO-PPP-QQQ-50001
AAA-BBB-CCC-DDD-50002
AAA-BBB-CCC-DDD-50003
NNN-OOO-PPP-QQQ-50002
If I was to create a new record with the combination of AAA-BBB-CCC-DDD,
then the sequence number would need to be 50004.
However, if I create a new record with a new combination (FFF-GGG-HHH-III,
then the sequence number would need to be 50001 again.
I have no earthly idea how to query the table behind the scenes of a form to
find out what number to assign to the sequence field.
Guidance would be greatly appreciated.
Thank you,
Debra Ann