Is it possible to trigger a script when a tab is clicked in Vendor Maint/Inquiry

I'd like to trigger a script when a user clicks on the "Invoices" tab (and other tabs) in Vendor Maintenance.  The goal is to restrict access to the tab depending on a UDF checkbox on the AP_Vendor table.  Does anyone have ideas (or alternatives) on how to accomplish this?