Solved

Access 07 - VB Code or Macro?

Posted on 2011-09-04
6
341 Views
Last Modified: 2012-06-27
Hi yall!  I am a novice programmer that started out years ago in Basic, and then Visual Basic, and now I mainly play with VBA in Access, currently AC07.

Not being a professional, most of what I create is from examples and borrowed code.  I am more comfortable with code, and was never a fan of macros.  I noticed that AC07 has a function to convert macros to code.

My question is: Why not do this?  Is there a reason that a macro would work better than code.  Is code faster, slower, etc.  Have you run into the coversion routine causing a previously working function to stop working when converting to code?

Looking for some informed opinions and an education ....
0
Comment
Question by:callstate
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 13

Assisted Solution

by:Ashok
Ashok earned 100 total points
ID: 36481486
Is code faster?
Yes

You can find and learn almost everything using Internet Search engine.

http://www.anthony-vba.kefra.com/vba/vbabasic2.htm

http://www.mrexcel.com/articles.shtml#Formulas

HTH
Ashok
0
 
LVL 21

Accepted Solution

by:
Boyd (HiTechCoach) Trimmell, Microsoft Access MVP earned 200 total points
ID: 36481690
There are many advantages to using VBA code.

Pros:
1) It is compiled.
2) Has error handling.
3) Easy to protect.
4) Can do many things Macros can do,

Cons:

Uh ... not sure if there are any

About macros:

Starting with Access 2007 the Macro Editor have been improved. The improvements continued in 2010.

With the improvement of macros you can do more without VBA code. This was to make the it more safer from security risks form VBA.  So in Access 2007 is you used only macros you did not have to worry about trusting your VBA code.

In Access 2010 the new web database was introduced. It does not use any VBA code. Only macros.

For security reason Macros are still limited in what the can do. VBA is a very powerful programming language.  In the past I l used VBA for everything except the  few things only macros can do.   I have been experimenting with Embedded Macros in 2007/2010.    

If I want a web app I would use ASP.net or some other platform before I would  Access.
0
 
LVL 3

Assisted Solution

by:sofsol
sofsol earned 100 total points
ID: 36482115
Many business users only ever want to get a problem solved and move on - which macros lets them do faster if they don't have the VB background. People who want to get serious will use the macro converter to learn VB, and if you have the VB knowledge then VBA is the way to go.
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 

Author Comment

by:callstate
ID: 36484087
I do have a novice VB background, and I am primarily a business user.

The database project that I am working on is only used in my business, and will not be shared outside of out LAN, so I do not believe I have 'trusting' issues.

An issue I have experienced is using the 'convert macro to vb' function, and then having to figure out why the code won't work.  Usually syntax errors like quotes being there, etc.

I was wondering if this was a common problem when using this function
0
 
LVL 74

Assisted Solution

by:Jeffrey Coachman
Jeffrey Coachman earned 100 total points
ID: 36484934
< I noticed that AC07 has a function to convert macros to code.>
IIRC, all versions of Access since 2000, had this utility...

In any event...
For the most part, the conversion utility is actually pretty good.
However, "Simple" macros will sometimes convert not so simple (or in many cases, inefficient) VBA code.
Or it will not be inherently obvious how to adapt the "converted" vba to actual code that will work in your database.
So this is more of a "Limitation" than a "problem".

Again, this is why most Access developers will opt for using VBA.

For me, the big issue with Macros is that they are only applicable in MS Access.
No other program (even in the Microsoft world) uses this language.

VBA has it roots in VB, and has evolved into the .net platform.

I am no basher here, ...as was stated, ...if you need to create an MS Access "Web" database specifically, ...then macros are currently your only option.

If you are not creating a Web DB, then I would stick with VBA.

The bottom line here is the 95% of all Access solutions here will be VBA, not macros.
So if you need help with something, more VBA will be available than Macros.
;-)

JeffCoachman

0
 

Author Closing Comment

by:callstate
ID: 36485885
Thank you all!
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Creating a Temp Table in MS Access 5 44
Parameter Query 33 50
Access #Deleted data 20 39
MS Access Query Criteria How To Handle Many ORs 4 21
Article by: Leon
Software Metering within our group of companies has always been an afterthought until auditing of software and licensing became a pain point. Orchestrator and SCCM metering gave us the answer and it was an exciting process.
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question