This is the wrong way to approach this as ajax has said. You should use an autonumber as your primary key. You then have two options:
1. set the display format of the autonumber field to be "EU17/" & AutonumberfieldName any time you need to display it. This may give you non sequential numbers
2. Keep your autonumber primary key field but make this other field a non primary key index field.
The syntax you want is
Code:
dim sMaxID as string
dim sNewMaxID as string
sMaxID = dmax("[ID]", "SAPRequests")
snewmaxid = left(smaxid, 5) & right("0000" & cint(right(smaxid, len(smaxid) - 5))
just bear in mind this will bomb out after you hit record 9999