Reputation: 1
I dont want the buttons to produces "embed macro" . I tries to press the convert icon to VBA , but still when i use the wizard of buttons it remains to be macro instead of vba procedure , why ? thank you
Upvotes: 0
Views: 5200
Reputation: 341
Beginning with Access 2007, Microsoft built a stronger, more capable macro system that they hope will be able to mostly replace VBA due to the inherent security differences between VBA and macros. There is not, as of yet, a simple way to make Access 2007 or 2010 create VBA code instead of macros when using wizards.
There are two ways some people have had success getting Access to create VBA or converting macros to VBA.
Create an Access 2003 database (.mdb) file. This will create a db compatible with the older versions of Access that don't have the robust macro system and so the code created will be VBA for the most part. The drawbacks of this will be if other functions in your database require the newer Access functions.
After the macro is created, save it as a separate macro rather than an embedded macro. Then in the Design ribbon in the Tools group, the Convert Form's Macros to Visual Basic should work more reliably. The converter is still not very reliable, and if it errors out, there is usually not a way to fix the issue.
Upvotes: 0
Reputation: 8043
Create a button without the wizard.
Right-click on the button and select Build Event. Choose "Code Builder"
The Microsoft Visual Basic IDE should open.
You can also access the buttons events from the Properties Sheet | Event tab.
Upvotes: 1