try
Dim ANumberDbl As Variant
If IsNull(Me.ANumber) = True Then
'Search for largest A Number in database (forced A Numbers are largest)
MaxForcedANumber = DMax("ANumber", "tbl_AllClients")
ANumberDbl = CDbl(MaxForcedANumber) + 1
ANumberDbl = Cstr(ANumberDbl)
Me.ANumber = Mid(ANumberDbl, 1, 3) & "-" & Mid(ANumberDbl, 4, 3) & "-" & Mid(ANumberDbl, 7, 3)
End If