Home > database >  VBA acces auto numbering failure
VBA acces auto numbering failure

Time:02-28

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.

CodePudding user response:

Use DMax:

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