UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Teaching A Old Dog New Tricks? - Or - A New Dog Old Tricks?, Access 2016    
 
   
Johan Strydom
post Jun 15 2020, 03:21 PM
Post#1



Posts: 3
Joined: 14-June 20



Having last used access 10 years ago (I think it was 97) I discovered a whole lot has changed.
One notable difference is the form buttons that now use a [event macro] as default instead of a [event procedure]
I can still remember to program simple actions in VBA but is it worth it working with macro’s now for the simple tasks like opening a form and adding a few conditions and functions? Why did this change?
I found some - Macros Vs Vba - Why Use Macros? posts in UA that was good reads but it was written in 2004.
Any new updates
Go to the top of the page
 
June7
post Jun 15 2020, 03:33 PM
Post#2



Posts: 1,527
Joined: 25-January 16
From: The Great Land


You can set application to default to VBA with design wizards..

File > Options > Object Designers > check Always Use Event Procedures

If you don't want control wizards to trigger then de-select the "Use Control Wizards" option in the Controls dropdown on ribbon.

I never use macros. I seldom use wizards.

This post has been edited by June7: Jun 15 2020, 03:35 PM

--------------------
Attachments Manager is below the edit post window. To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Go to the top of the page
 
GroverParkGeorge
post Jun 15 2020, 03:48 PM
Post#3


UA Admin
Posts: 37,482
Joined: 20-June 02
From: Newcastle, WA


Macros vs VBA. A long-running discussion, indeed.

Most seasoned developers do gravitate to VBA because of the greater power, flexibility, robust error handling and ability to manage complex logic.

On the other hand, for some basic functions like opening or closing a form, macros can be handy. I like to have a command button with a macro that only closes the form on which it is placed. Embedded macros are included in a copy/paste of the control, so if you want to put the same close button on a dozen forms, it's simply copy/paste 11 times.

Over time, I think many serious developers do move more away from the Control Wizards, mainly because, IMO, the code they produce tends not to be the most appropriate in some situations. But they do work just fine in a great majority of cases.

--------------------
My Real Name Is George. Grover Park Consulting is where I did business for 20 years.
How to Ask a Good Question
Beginning SQL Server
Go to the top of the page
 
DanielPineault
post Jun 15 2020, 04:12 PM
Post#4


UtterAccess VIP
Posts: 7,383
Joined: 30-June 11



Macro are, generally a pain to work with. For instance, they are hard to search (no find and replace like in VBA). It's also a pain that MS split the commands and you always need to click on the Show All Actions, every single time!

Personally, I find VBA more compact and easier to read. Some macros I've seen span multiple screens and just don't compare to VBA.

I also like the power that VBA gives. Macros can take you a good way, but ultimately, I always end up needing VBA anyways, so why breakup my work, so I just use VBA 100%. By using VBA, it also allows me to lock my object from being exported when I apply a password to my projects. So added security that using Macros does not offer.

That said, a lot of it is very subjective.

--------------------
Daniel Pineault (2010-2020 Microsoft MVP, UA VIP, EE Distinguished Expert 2018)
Professional Help: https://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: https://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc


All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions)
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    9th July 2020 - 02:49 AM