thanks for the suggestionR915 = "R9" & Right("R914", 2) +1
thanks for the suggestionI would go with "R" & Right(FieldName,3)+1 as you are going to get unstuck at 99 otherwise?
Always better to keep them separate and combine when needed.
Code:tt="R914" ? "R" & Right(tt,3)+1 R915
I would now go with CJ_London's offering.thanks for the suggestion
Do all rows have the leading character R in this column, or do subsets of rows have different leading characters?Given a table field that has the value "R914", how might I go about generating the next numerical value "R915" in either vba code or a query?
Private Function GetNameID(strGender As String, intStartSequence As Integer)
strCriteria = "Gender = """ & strGender & """"
GetNameID = Nz(DMax("NameID", "NamesByGender", strCriteria), intStartSequence - 1) + 1
End Function