Hi All,
I'm looking for some help correcting my code below.
What I'm trying to accomplish is when a user selects a value from a dropdown field on a form that value of the field code in the table Support Detail is checked by the code and incremented by 1
The field code is a concatenation of Region (NA, EU, AP) the letters MN and a numeric value.
What I'm getting from my code below is the Region selected, 'MN' and 1. Example EUMN1
I've also tried
fyi, the above "fieldnamedcode " is just code, but I can't post it that way as it causes and issue for the forum
Any assistance you can give me is appreciated
Thanks
I'm looking for some help correcting my code below.
What I'm trying to accomplish is when a user selects a value from a dropdown field on a form that value of the field code in the table Support Detail is checked by the code and incremented by 1
The field code is a concatenation of Region (NA, EU, AP) the letters MN and a numeric value.
What I'm getting from my code below is the Region selected, 'MN' and 1. Example EUMN1
Code:
Private Sub Region_AfterUpdate() 'autonumber
If Me.NewRecord Then
Me.Code = Me.Region & "" & "MN" & Nz(DMax("val(Right('[fieldnamedcode]',Len('[fieldnamedcode]')-4))", "[Support Detail]") + 1, "0000")
End If
End Sub
Code:
Private Sub Region_AfterUpdate() 'autonumber
If Me.NewRecord Then
Me.Code = Me.Region & "" & "MN" & Nz(DMax("val(Right('[fieldnamedcode]',4))", "[Support Detail]") + 1, "0000")
End If
End Sub
Any assistance you can give me is appreciated
Thanks
Comment