Try the following code:
Private Sub Form_BeforeInsert(Cancel As Integer)
On Error GoTo Form_BeforeInsert_Err
' Set Purchase Order No to "Max" + 1
Forms!PurchaseOrder!PurchaseOrderNo = DMax("[PurchaseOrderNo]", "Purchasing"

+ 1
If (IsNull(Forms!PurchaseOrder!PurchaseOrderNo)) Then
' If result was Null (this is the first Purchase Order), set to 1
Forms!PurchaseOrder!PurchaseOrderNo = 1
End If
Form_BeforeInsert_Exit:
Exit Sub
Form_BeforeInsert_Err:
MsgBox Error$
Resume Form_BeforeInsert_Exit
End Sub
-------
Modify the code to suit your needs. If you want the numbering to start at a different number other than 1, then modify the following line of code to read the 1st number you want the records to start at:
Forms!PurchaseOrder!PurchaseOrderNo = 1