VBA acces auto numbering failure

Viewed 31

For a registration tool we always created the case ID by the following line of code.

Me.RMA_Nr = Format$(Now(), "yymm") & Format$(Val(Right$(DLast("[RMA-Nr]", "TBL_RMA_ISSUE"), 3)) + 1, "000")

unfortunatly we get now always the same issue number where should I look where this is going wrong. this line worked for over a year.

1 Answers

Use DMax:

Me.RMA_Nr = Format$(Date(), "yymm") & Format$(Val(Right$(DMax("[RMA-Nr]", "TBL_RMA_ISSUE"), 3)) + 1, "000")
Related