Access Database Systems

WelcomeBlog

Are your business objectives being met?

Do you need specialised Access database consulting or an Access database solution? Our software is dedicated to providing assistance toward increasing efficiency and productivity of the small or medium sized business.

If you do not have the resources or time to develop software for your business, you may find something of interest here.

Posts Tagged ‘MS Access macro’

Creating a VBA Access database

Wednesday, February 10th, 2010

You can create powerful Access databases with no programming code at all. There may be a situation though when you do need some specialized functionality and then you will have to create a VBA Access database.

The programming language used in all the MS Office products is VBA which stands for Visual Basic for Applications.

How do we go about this? It really depends on the type of functionality you require, but chances are you will find yourself creating sub procedures and functions. This will hold the main code of your program.  Code can be put behind the forms itself or in code modules.

There is a bit of a learning curve however when it comes to creating a VBA Access database. It takes time to become confident and proficient in a programming language.

You can also get proficient in the MS Access macro language which will give you a start in how logical statements flow. MS Access macros are essentially VBA Access statements, but are much easier to use.

If you feel confident to attempt a VBA Access database then you should, otherwise enrol in a good training course. There are also plenty of good books on the MS Access VBA language.

How to use the autoexec macro

Monday, February 1st, 2010

The autoexec macro is used to run actions when the database is opening. For example, you may wish to perform a data update before the system becomes active. You can do a similar thing with the start up options, but the autoexec macro will allow you to run more than one action.

Lets look at how we can use the autoexec Access macro to open a form and move to a blank record for entering data.

Load up a database.

Go into the macro designer.

In Access 2007 at the Ribbon you would click on the create tab.

Then click on the macro icon at the far right hand side.

In the action column select the ‘OpenForm’ action.

MS Access Autoexec Macro

At the bottom of the screen you will see an area for action arguments.

Select the name of the form to open

Make sure the view says form.

Now select another action of ‘GoToRecord’.

At the bottom of the screen you will see an area for action arguments.

Select an object type of form.

The object name will be the form you are opening.

Set record to be new.

That’s it…..

Now just save the macro with the name of ‘Autoexec’.

Close the macro designer window.

Exit the database.

Now run the database.

The autoexec Access macro will immediately kick in and you will be taken to a brand new record in the form you specified.

The autoexec macro enables us to control what we want to take place when the database is opening.

Click here MS Access macro if you want to learn more about macros.

Create a PDF file with a Microsoft Access macro

Tuesday, January 26th, 2010

In Microsoft Access 2007 one of the new features is to save data as PDF format files. You can also do
this by using Microsoft Access macros.

Load up the macro designer and click on the actions column. Scroll through the list of actions until you find one called ‘OutputTo’. Select this action.

At the bottom of the screen you will see the Microsoft Access macro action arguments.

-The object type will be the object you are using which could be a table, query, form etc.

-The Object name will be the name of the object – for example you may have a table called customers.

-Output format will be the type of format you wish to output the object to. This could be html, excel etc. Select PDF format here.

Output file will be the path of where you want the output to be saved.

The only other setting here which you could use is ‘Output quality’. Set this to be ‘Screen’.

Microsoft Access macro

Now save and run the Microsoft Access macro.

In Windows locate the area where your PDF was saved and open it up.

Click here to get more help with the Microsoft Access macro

MS Access Macro – How To Open a Report

Wednesday, January 20th, 2010

An MS Access macro is a great tool for automating our databases. We can use Microsoft Access macro actions for many tasks.

In this demonstration I am going to open a report by using a macro.

The MS Access macro designer has three main columns
1. Macro Name
2. Action
3. Comment

Enter the name of the new MS Access macro in the ‘Macro Name’ column.
Now move to the ‘Action’ column and select the ‘OpenReport’ action.
Look towards the bottom of the screen and you will see the action arguments section. Enter the name of the report in the report name section. In the view section select the view you wish to see the report in. In this example I want to see it in print preview mode.

Now save the MS Access macro and close the designer window.

Create a brand new form in design view.
Now make sure the wizard button is clicked as you want to use a wizard for the next step.
From the toolbox control area you want to click the command button control.
Drop the button onto the form.
The wizard will now load and you will see two columns – categories and actions.
Select from the categories box the option called miscellaneous.
From the actions box select the run macro action.
Click the ‘Next’ button and on the next screen select the macro that you saved earlier.
Click the ‘Next’ button and on the next screen add text to the button.
Click the finish button.

Now run the form and click your command button.
The Microsoft Access macro will run and your report will open in print preview mode.

The MS Access macro makes our life so much easier. We don’t need to learn complex programming code to add power to the database.

To further your learning of the MS Access macro check out this great new MS Access macro ebook.