This should do it:
Public Function NextNumber(strTable As String, strField As String, _
Optional strCriteria As String) As Long
On Error Resume Next
Dim lngMax As Long
lngMax = Nz(DMax(strField, strTable, strCriteria), 0&)
NextNumber = lngMax + 1&
End Function
Example for field ID in table Table1:
? NextNumber ("Table1", "ID")

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
> Hello all,
> I have function that finds the next record in a table. I use this function
[quoted text clipped - 10 lines]
> Thanks in Advance
> Anand