02 December, 2009

The VBA Source for making the Purchases Account Required in PO Entry

I did a blog post a while back where I made available the functionality to force users to enter a Purchases Account on PO Lines when one didn't automatically default in.  That was compiled with the VST for GP.  Since, I've received several requests for the VBA source code to do the same.  Finally, I've gotten around to posting that for you.  You can download the .package file here.

I know there's a better way to do this other than using ADO to check for the presence of the account number but someone much smarter than I once said "if it works, it's the right way".  I'm sticking with that here but would like to hear about the techniques other are using to do the same or similar customizations.  Please comment and share.

This will only work on GP 10 and importing the package file will overwrite any existing VBA code behind POP Entry and POP Item Detail Entry.  Thus, the reason why I prefer using the VST version in this situation.

2 comments:

Landon F said...

I have also accomplished this with the use of a SQL Table Trigger. You can use the trigger to assign a clearing account to an empty PURCH distribution and auto reverse it with a MISC distribution. The users can then code the distributions in summary using MISC distributions.

Thanks for the post!

MichaelJ2 said...

That's great! Not the same thing though. The trigger will automatically assign the account if one does not default in. Why not just assign the clearing account as the default for the Vendor instead of using the trigger?

If you want the right account on the PO Line and can't use a single default account this customization is a good way to ensure that the right account number is entered by the user during PO entry without any additional steps.

Thanks for the feedback.