SQL in Access to automate the PO Number (1 Viewer)

Mark_

Longboard on the internet
Local time
Today, 09:37
Joined
Sep 12, 2017
Messages
2,111
Luzz,

If the company is always going to be the same and does not change regardless of the customer, do not include it in your PO number. Use the text literal your company uses instead. To get it to look proper you can use a field that has its Field.Caption = "Company Name " & Me.PONumber.

If your company really really really insists on rolling the PO numbers by year you can use two field; [Year] and [PO] to accomplish this. You can use

Me.[Year] = YEAR(DATE())
Me.[PO] = DCount("*","[FILE]","[File].[Year] = " & Me.Year ) +1

to set your PO number.

As others have said it would be much better to simply have an autonumber for PO number. It also avoids some customer service issues when the customer doesn't realize they need to include the year when talking about PO numbers.

Oddly, most managers will listen to "Hey, I've got a way to help avoid problems with looking up purchase orders" more than "This is easier for me to do".
 

Users who are viewing this thread

Top Bottom