Access Macros – Lets do a Trivial Example Together



Access Macros – Lets do a Trivial Example Together

0 0


accessmacroslides


On Github ninjapanzer / accessmacroslides

Access Macros

Adding your own functionality

or

Say yes to programming

Created by Paul Scarrone / @PaulSCoder

Lets Get Started

Access File

What is a Macro?

Set of ordered instructions for the purpose of automating frequently used tasks

Mention: Speed up editing and formatting Option Dialogs more accessible

Programming you say

Basically yes with a focus on the basically

Mention: Speed up editing and formatting Option Dialogs more accessible Many functions that are already present in Access act as macros

What does a Macro Look Like?

Lets do a Trivial Example Together

We are going to construct a form and give it some functionality

We start with a blank form

Create Tab -> Blank Form

Then we Add Some Controls

In Design View -> Need a text box and some buttons If buttons are in wizard mode click cancel

Make a form that looks something like this

Some housekeeping

Its always a good idea to get an idea of what our controls are named and setup their default values.

Set the default text property of our text box to something fun.

Right click element go to properties -> Data -> default value

Now for the Fun...Programming :)

Our Goal is to make this form change the value in the text field to happy/sad depending on the button clicked

Lets get into macro view

Right click a button and select 'Build Event'

Here is our 'Sad' button

Notice the action catalog to the right as well

Lets talk about what we did here

Your turn!

Go ahead and try and make the happy button do its job

Sit around and wait

Congratulations

While this could be considered trivial being able to interact with properties is very important to generating rich applications

Remember programming is all small trivial pieces

Some Clapping

Where do you see opportunties for useful macros?

Lets say we get off the jungle gym and hope into the business world.

Do you want to play a game?

Access may be a database engine but that doesn't mean we can't have some fun too

Rock Paper Scissors

Checkout RPS

THE END?

BY Paul Scarrone