VB Code for Events


When you right-click on a form object and select 'Build Event' Access usually gives you the option of the Expression Builder, the Macro Builder, or the Code Builder. Most developers will always want the 'Code Builder' - the VB editor - so that that can edit VBA code and there is a simple way to get this automatically.

Select Options from the Tools menu then pick the Forms/Reports tab. Click the tick box labelled 'Always use event procedures' then use the OK button to close the Options dialog.

The next time that you try to create code for an event Access will bypass the choices of Expression Builder and Macro Builder and will take you straight to the VBA code editor.

This works in all versions of Access from 97 to 2002.