Hi all,
I'm thinking this might be fairly simple and use Dmax, but I'm struggling to get my tired, amateur brain around it and surprisingly can't find any examples in the mighty Goo.
I need to produce two sets of sequential reference numbers within the same field based on the value of another field. REFA000001, ...2, ...3, etc. and REFB000001, etc. The primary key would not be involved.
It would work something along the lines of (bad syntax just for demonstration):
If [criteriafield] > 0 Then [REF] = "REFA" & DMax(REFA) + 1
Else
If [criteriafield] = 0 Then [REF] = "REFB" & DMax(REFB) + 1
I guess the code would execute on the After Update event of the [criteriafield] control.
I hope that is clear enough. Help, clues or criticism would be hugely appreciated.
I'm thinking this might be fairly simple and use Dmax, but I'm struggling to get my tired, amateur brain around it and surprisingly can't find any examples in the mighty Goo.
I need to produce two sets of sequential reference numbers within the same field based on the value of another field. REFA000001, ...2, ...3, etc. and REFB000001, etc. The primary key would not be involved.
It would work something along the lines of (bad syntax just for demonstration):
If [criteriafield] > 0 Then [REF] = "REFA" & DMax(REFA) + 1
Else
If [criteriafield] = 0 Then [REF] = "REFB" & DMax(REFB) + 1
I guess the code would execute on the After Update event of the [criteriafield] control.
I hope that is clear enough. Help, clues or criticism would be hugely appreciated.
Comment