How do I stop the control wizrd from creating embedded macros?


G

Guest

I want the control wizard to create VBA code, not embedded macros. I checked
the "Always use event procedures" box in the Access Options - Object
Designers, but the wizard still creates embedded macros instead of VBA code
(tried several combo boxes and command buttons on different forms). What am
I missing?
 
Ad

Advertisements

D

Douglas J. Steele

What version of Access?

I've never seen the wizard create a macro, although I haven't used the
wizard in Access 2007.
 
G

Guest

Sorry ... Access 2007. By default, Access 2007 creates embedded macros (new
in 2007 - I think). By changing the option setting, it should create VBA
code instead. But, for some reason, I can't get it work.
 
G

Guest

Douglas:

FYI: In my search for an answer (which I still do not have), I came across
this article which explains why Access 2007 has embedded macros:

-------------------------------------------

Saturday, April 21, 2007 4:26 AM clintc
Reader question about macros and VBA
A reader recently asked:

Is there any way on Access 2007 to keep wizards and Switchboard Manager
coding in VBA, any way developers "HAVE" to code for most applications.
If a customer is buying an apllication from us, he is not going to trust
what he bought?.
Switchboard manager was great in its code handling.

Good question. Let me back-track a little into the annuals of the decision
to move the button wizard from VBA to macros. There are a significant
percentages of Access databases that are built by information workers that
have very little code. One of the many goals for Access 2007 was to expand on
this and allow IWs to build better applications without writing code. The new
security model allows users to run databases without any VBA code enabled
(this is important for many organizations). As you know, trusted locations
make it much easier to deploy databases with code. Our wildly popular
templates are functional databases that don't have code. Feedback on the
templates have been positive.

We started running into scenarios where IWs opened a database and added a
switchboard or button that didn't work. Users were confused--they didn't work
because the database wasn't enabled. As many of you have complained about
over the years, the wizards also wrote out poor examples of VBA (doMenuCmd 97
kind of stuff). To fix the problem we converted the wizards to write out
embedded macros that run in untrusted databases. We also spent time cleaning
up the code they generate to provide users with better learning examples.

We did consider a flag to write out either VBA or macros but the feature was
one of many things we wanted to do that didn't make it into the release. :-(
Beta 2 shipped and we got lots of feedback from beta testers (Pat Hartman and
John Viescas were particularly vocal) that they wanted a way to convert
embedded macros to VBA. As a late change we made it possible to convert
embedded macros to VBA. You can find the command on the Database tab under
Macro.

Do we think everything should be written in macros? No--they aren't a
replacement for VBA. VBA will continue to ship and be supported in the
future. Macros are turning out to be useful for simple actions that took a
few lines of code. We find that IWs are much more successful making small
changes to macros than VBA. I have yet to hear a perf complain on macros
verses VBA, so performance shouldn't be an issue. Long-term, we intend to
continue to innovate in this area and make macros more useful for broader
developer scenarios.

Thanks for your question and hope this explains our logic.

Filed under: Developer, Templates, Access 2007

--------------------------------------
 
D

David

Douglas:

FYI: In my search for an answer (which I still do not have), I came across
this article which explains why Access 2007 has embedded macros:

-------------------------------------------

Saturday, April 21, 2007 4:26 AM clintc
Reader question about macros and VBA
A reader recently asked:

Is there any way on Access 2007 to keep wizards and Switchboard Manager
coding in VBA, any way developers "HAVE" to code for most applications.
If a customer is buying an apllication from us, he is not going to trust
what he bought?.
Switchboard manager was great in its code handling.

Good question. Let me back-track a little into the annuals of the decision
to move the button wizard from VBA to macros. There are a significant
percentages of Access databases that are built by information workers that
have very little code. One of the many goals for Access 2007 was to expand on
this and allow IWs to build better applications without writing code. The new
security model allows users to run databases without any VBA code enabled
(this is important for many organizations). As you know, trusted locations
make it much easier to deploy databases with code. Our wildly popular
templates are functional databases that don't have code. Feedback on the
templates have been positive.

We started running into scenarios where IWs opened a database and added a
switchboard or button that didn't work. Users were confused--they didn't work
because the database wasn't enabled. As many of you have complained about
over the years, the wizards also wrote out poor examples of VBA (doMenuCmd 97
kind of stuff). To fix the problem we converted the wizards to write out
embedded macros that run in untrusted databases. We also spent time cleaning
up the code they generate to provide users with better learning examples.

We did consider a flag to write out either VBA or macros but the feature was
one of many things we wanted to do that didn't make it into the release. :-(
Beta 2 shipped and we got lots of feedback from beta testers (Pat Hartman and
John Viescas were particularly vocal) that they wanted a way to convert
embedded macros to VBA. As a late change we made it possible to convert
embedded macros to VBA. You can find the command on the Database tab under
Macro.

Do we think everything should be written in macros? No--they aren't a
replacement for VBA. VBA will continue to ship and be supported in the
future. Macros are turning out to be useful for simple actions that took a
few lines of code. We find that IWs are much more successful making small
changes to macros than VBA. I have yet to hear a perf complain on macros
verses VBA, so performance shouldn't be an issue. Long-term, we intend to
continue to innovate in this area and make macros more useful for broader
developer scenarios.

Thanks for your question and hope this explains our logic.

Filed under: Developer, Templates, Access 2007

--------------------------------------






- Show quoted text -
So has anyone got a solution to this yet?
 
D

David Semon

Not yet ... I'm still trying to figure out what is going on. Even reloaded
MS Office. Still a problem.

Dave Semon
 
Ad

Advertisements

Joined
Jun 25, 2015
Messages
1
Reaction score
0
Does it help if you go to the form design ribbon, controls group, click the drop down, deselect use control wizards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top