I have run a table called tbldoctype.(Does other things as well). Includes An AutoID: "RefType", Description: (PO), (Bill of Lading) whatever, "Counter" which is the current number (default value of 1), "UseCounter" (True/False - set true for PO's). On your PO form new record command:
DoCmd.GoToRecord , , acNewRec
Me![NameOfYourPONumberField] = NextNumber(1) '1 is the doctype number for Po's.
Add this function to a public module:
Public Function NextNumber(RefType As Variant) As Variant
On Error GoTo ErrNN
Dim SQL1 As String, Rs As Recordset, Db as Database
SQL1 = "SELECT tbldoctype.* FROM tbldoctype WHERE (((tbldoctype.RefType)= " & RefType & "

AND ((tbldoctype.UseCounter)=True))"
Set Rs = db.OpenRecordset(SQL1, dbOpenDynaset)
If Rs.RecordCount = 0 Then
Rs.Close
GoTo ErrNN
End If
NextNumber = Rs!Counter + 1
Rs.Edit
Rs!Counter = NextNumber
Rs.Update
Rs.Close
ExitNN:
Exit Function
ErrNN:
MsgBox Err.Number & " " & Err.Description, vbInformation, "Next document number generation error."
Resume ExitNN
End Function
There are other issues with this: Your user should first be asked if they really want to create the record, and they must be unable to delete it once set. In some cases I cannot do this and run a twin function called PreviousNumber which, you guessed it subtracts one from the count in the event of delete. Now you can manage all your "document numbers from one table and start them at any point you choose. Enjoy!
Gord
ghubbell@total.net