We have used VBA to lock the PO date in Transactions > Purchasing> Purchase Order Entry, so that the user can't change the PO date. It always defaults to the Toolbar date...
Now, if a user opens an OLD PO it (correctly) shows the OLD PO date... and that's what we want... and if they make a change and save it, that OLD PO date is saved along with the record as well... and that's what we want.
HOWEVER, when the new, blank PO screen is displayed, it continues to show that OLD PO date... not the date on the toolbar.
My understanding of VBA is a bit limited... so what would be the syntax if the window is still open... that is, it never closed.... we just changed and saved a record, and are starting to enter a new record... and want to make the date default back to the toolbar date?
Here's our existing VBA code:
Private Sub Window_AfterOpen()
Me.OldDate.Locked = True
End Sub
What I need is a clause that says:
If new record
set date back to toolbar date
End If
Now, if a user opens an OLD PO it (correctly) shows the OLD PO date... and that's what we want... and if they make a change and save it, that OLD PO date is saved along with the record as well... and that's what we want.
HOWEVER, when the new, blank PO screen is displayed, it continues to show that OLD PO date... not the date on the toolbar.
My understanding of VBA is a bit limited... so what would be the syntax if the window is still open... that is, it never closed.... we just changed and saved a record, and are starting to enter a new record... and want to make the date default back to the toolbar date?
Here's our existing VBA code:
Private Sub Window_AfterOpen()
Me.OldDate.Locked = True
End Sub
What I need is a clause that says:
If new record
set date back to toolbar date
End If