Canillo
BSA 4 Infotech 4A
Macro
• A macro (from the Greek "μάκρο" for big or far) in computer science is a rule or pattern
that specifies how a certain input sequence (often a sequence of characters) should be
mapped to an output sequence (also often a sequence of characters) according to a
defined procedure. ...
• The Shaggy parasol is the common name for two closely related species of mushrooms,
Chlorophyllum rhacodes and C. brunneum, found in North America and Europe (the
latter species is also found in Australia).
• The Macros is a Big Finish Productions audio drama based on the long-running British
science fiction television series Doctor Who.
• A series of program commands or instructions which are stored in a file and can be
recalled when necessary. Macros are commonly used to customise high-end GIS toolkits
for individual applications.
• A set of instructions that are represented by a word. When this word is inserted in the
source code, the compiler replaces the word with the set of instructions that the word
represents. Macros are used for common tasks. The macro serves to keep the source code
more readable.
3. Use the dropdown menu to select your second action - choose "GoToRecord". In the
bottom pane, choose the record you want to go to - choose "New". What we're doing here
is ensuring that the form doesn't open up a previous record - it goes straight to the end
and has a blank record ready for you to enter a new record (this saves time and
unnecessary clicks).
4. You're now ready to save your macro. To do this, click on the "Save" icon and enter a
name for your macro. Make sure you name this macro "Autoexec". By naming it
Autoexec, we are instructing Access to run this macro everytime we open the database.
Now that you've created your macro, it's time to test it! Close your database and then open it
again. You will notice that when you open it, the Individual Form automatically opens and is
ready for you to enter a new record. You can also run macros by opening the Macros tab and
double clicking on the macro you want to run (or selecting it and clicking "Run").
Macro Actions
Opening and Closing Tables, Queries, Forms, and Reports
Macro Action Purpose
Close Closes specified or active window for a table, query, form, or report.
OpenForm Opens a form in Form, Datasheet, or Design view, or in Print Preview. Can apply filter or Where condition.
OpenModule Opens a module in Design view and displays the named procedure.
OpenQuery Opens a query in Datasheet, Design view or in Print Preview. If an Action query, updates performed. To specify
parameters for an Action query, use the RunSQL action.
OpenReport Opens a report in Print Preview (the default), prints the report, or opens the report in Design view. For Print and
Print Preview, can also specify a filter or Where condition.
RunSQL Executes the specified SQL Insert, Delete, Select...Into, or Update statement. Can refer to form controls in the
statement to limit the affected records.
OpenForm Can also open in Print Preview. Can specify a filter or Where condition.
OpenReport Prints a report or opens a report in Print Preview. Can specify a filter or Where condition.
OutputTo Outputs the named table, query, form, report, or module to Excel (XLS), Word (RTF), or Notepad text (TXT)
file, and optionally starts the application to edit the file. For forms, the data output from the form’s Datasheet
view. For reports, Access outputs all controls containing data (including calculated controls) except memo,
OLE, and subform or subreport controls.
PrintOut Prints the active datasheet, form, or report. Can specify a range of pages, the print quality, the number of copies,
and collation. Use an Open action first if you want to apply a filter or Where condition.
CancelEvent Cancels the event that caused this macro to be executed. Can’t use CancelEvent in macros that define menu
commands, in OnClose for a report, or in macros triggered by the AfterUpdate, OnCurrent, OnEnter, or OnPush
event.
DoMenuItem Executes a command on a standard Access menu. Can use DoMenuItem in a macro that defines a custom menu to
make selected Access menu commands available in the custom menu.
RunCode Executes a Access Basic function procedure. Other actions following this action execute after the function
completes. (Note: To execute a Access Basic sub procedure, call that procedure from a function procedure.
RunMacro Executes another macro. Actions following this action execute after other macro completes.
StopAllMacros Stops all macros, including any macros that called this macro.
Setting Values
Macro Action Purpose
Requery Refreshes the data in a control that is bound to a query (such as a list box, combo box, subform, or a control
based on an aggregate function such as DSum). When other actions (such as inserting or deleting a row in the
underlying q uery) might affect the contents of a control that is bound to a query, use Requery to update the
control values. Use Requery without an argument to refresh the data in the form or datasheet
SendKeys Places keystrokes into the keyboard buffer. If you intend to send keystrokes to a modal form or dialog box, you
must execute SendKeys before opening the modal form or dialog box.
SetValue Changes the value of any updateable control or property. For example, can use SetValue to calculate a new total
in an unbound control or to affect the Visible property of a control (which determines whether you can see that
control).
ApplyFilter Restricts the information displayed in a form or report by applying a named filter or query or SQL WHERE
clause to the underlying table or query of the form.
FindNext Finds the next record that meets the criteria previously set or by FindRecord in the Find dialog box.
FindRecord Finds a record that meets the search criteria. Can specify in the macro action all the parameters available in the
Find dialog box.
GoToRecord Moves to a different record and makes it current in the specified table, query, or form. Can move to the first,
last, next, or previous record. When you specify "next" or "previous," can move more than one record. Can a lso
go to a specific record number or to the new-record placeholder at the end of the set.
AddMenu Adds a drop-down menu to a custom menu bar for a form or report. This is the only action allowed in a macro
referenced by a Menu Bar property. Each AddMenu macro action must have a name that corresponds to the
menu name on the menu bar of the custom menu. The argument to AddMenu specifies the name of another
macro that contains all the named commands for the menu and the actions that correspond to those commands.
An AddMenu action can also refer to another macro that uses an AddMenu action to build submenus.
DoMenuItem Executes a command on one of the standard Access menus. Use this macro within a custom menu bar to make
selected Access menu commands available in the custom menu.
MsgBox Displays a warning or informational message and optionally produces a sound. You must click OK to dismiss the
dialog box and proceed.
SetWarnings When enabled, causes an automatic Yes or OK response to all system warning or informational messages while a
macro runs. Does not halt the display of error messages. Use this macro with Echo set to Off to avoid displaying
the messages.
Hourglass Sets the mouse pointer to an hourglass icon while a macro runs.
RepaintObject Forces the repainting of the window for the specified object. Forces recalculation of any formulas in controls
on that object.
Requery Refreshes the data in a control that is bound to a query (such as a list box, combo box, subform, or a control
based on an aggregate function such as DSum). When other actions (such as inserting or deleting a row in the
underlying q uery) might affect the contents of a control that is bound to a query, use Requery to update the
control values. Use requery without an argument to refresh the data in the active object (form or datasheet).
SelectObject Selects the window for the specified object. Restores the window if it was minimized.
SetWarnings When enabled, causes automatic Yes or OK response to all system warning or informational messages while
a macro runs. Does not halt the display of error messages. Use with Echo set to Off to avoid displaying the
messages.
ShowToolbar Shows or hides any of the standard toolbars or any custom toolbar.
CopyObject Copies any object in the current database with a new name or with any specified name in another Access
database.
OutputTo Outputs the named table, query, form, report, or module to a Excel (XLS), Word (RTF), or Notepad text
(TXT) file, and optionally starts the application to edit the file. For forms, the data output is from the
form’s datasheet view. For rep orts, Access outputs all controls containing data (including calculated
controls) except memo, OLE, and subform or subreport controls.
SendObject Outputs a table datasheet, query datasheet, form datasheet, data in text boxes on a report, or a module
listing to a Excel format (XLS), Rich Text Format (RTF), or text (TXT) and embeds the data in an
electronic mail message. Can specify t o whom the message is to be sent, the message subject, additional
message text, and whether the message can be edited before it is sent. You must have electronic mail
software installed that conforms to the Mail Application Programming Interface (MAPI) st andard.
TransferDatabase Exports data to or imports data from another Access, dBASE®, Paradox®, FoxBASE®, Btrieve®, or
SQL database. Can also use this action to attach tables or files from other Access, dBASE, Paradox,
Btrieve, or SQL databases.
TransferSpreadsheet Exports data to or imports data from Excel or Lotus® 1-2-3® spreadsheet files. (Note: Can import
spreadsheet data from Excel versions 3 and 4, but cannot export Access data to these types of files.)
If you are creating lots of macros, you might want to consider organizing them into a macro
group to help you manage them. A macro group stores several related macros together in a single
macro object. When you create a macro group, you must give each macro in the macro group its
own unique name to identify where each macro starts and ends. You do this by entering the
macro names in the Macro Name column, which you display by clicking the Macro Names
button on the toolbar.
When you combine two or more macros within the same macro group, you must run them
separately, by referring to the macro group name, followed by the macro name. For example,
mcrEmployees. mcrEmployees frmEmployees refers to the Open frmEmployees macro in the
mcrEmployees macro group.
Today, we continue our discussion of Access macros and take a look at macro groups. If you
find yourself creating a large number of macros, creating macro groups can help you manage
your macros more easily. A macro group is a collection of related submacros all stored together
in a single macro object. If you have used macro groups in previous versions of Access, you may
be trying to figure out how to do the same in Access 2010 – as the process has completely
changed (it personally took me awhile to figure it out!).
In the illustration below, the macro group, named mcrOpenForms, is made up of three related
macros: OpenRegistration, OpenStudents and OpenClasses. The name next to the word
Submacro identifies each separate group of macro actions and specifies the beginning of the
macro. When the group is expanded, the words End Group mark the end of the macro in that
group. These three macros were included in this group because each macro carries out the
OpenForm action.
You can run a macro in a macro group in an event by typing the macro group name followed by
a period and then the macro name. In the preceding example, to refer to the OpenStudents macro
in the mcrOpenForms macro group, you would type:
mcrOpenForms.OpenStudents
Note that the Submacro action is different than the Group action. Group actions cannot be called
or executed – they mainly serve to increase readability by storing program flow in named,
collapsible blocks.
To Create a Macro Group
Note: You cannot run a macro group (a macro containing submacros) directly from the macro
window. Submacros can only be called by a RunMacro or OnError macro action.
Event Condition Action (ECA) is a short-cut for referring to the structure of active rules in
event driven architecture and active database systems.
• The event part specifies the signal that triggers the invocation of the rule
• The condition part is a logical test that, if satisfied or evaluates to true, causes the action
to be carried out
• The action part consists of updates or invocations on the local data
This structure was used by the early research in active databases which started to use the term
ECA. Current state of art ECA rule engines uses a many variations on rule structure. Also other
features not considered by the early research is introduced, such as strategies for event selection
into the event part.
In a memory-based rule engine, the condition could be some tests on local data and actions could
be updates to object attributes. In a database system, the condition could simply be a query to the
database, with the result set (if not null) being passed to the action part for changes to the
database. In either case, actions could also be calls to external programs or remote procedures.
Note that for database usage, updates to the database are regarded as internal events. As a
consequence, the execution of the action part of an active rule can match the event part of the
same or another active rule, thus triggering it. The equivalent in a memory-based rule engine
would be to invoke an external method that caused an external event to trigger another ECA rule.
ECA rules can also be used in rule engines that use variants of the Rete algorithm for rule
processing.
Arguments for an Access 2007 macro
It's only a small improvement but I was very pleased when I realised what had been added to the
macro designer in Access 2007. In previous versions - like the Access XP screenshot opposite -
you've only been able to see the details of one row in the macro at a time.
In the example the designer is on the first action in the macro and can see from the bottom pane
that this OpenForm action opens the ClubEntry form in a normal window in Edit mode. The only
way to find out what the second OpenForm does is to scroll down three rows and look at the
Action Arguments for that line. By doing that of course you lose sight of the details of the first
line and so comparing the details of two actions in a macro becomes a long job. The Comments
column can be a help but my usual problem is that I want to compare the syntax of the two lines
to discover why one is working but the other is failing.
Melchor B. Canillo
BSA 4 Infotech 4A
InformationTechnology:
All our work related applications are now completely automated, thanks to the IT sector.
IT professionals are people involved in essential management of sensitive data,
exclusive computer networking and systems-engineering. The advancement of the IT
sector has resulted in automated:
• Administration of entire systems.
• Production and manipulation of sensitive information.
• Cultural development and communication.
• Streamlining of business processes and timely upgradation.
Advantages of Information Technology:
The advantages of information technology are many. True globalization has come about
only via this automated system. The creation of one interdependent system helps us to
share information and end linguistic barriers across the continents. The collapse of
geographic boundaries has made the world a 'global village'. The technology has not
only made communication cheaper, but also possible much quicker and 24x7. The
wonders of text messages, email and auto-response, backed by computer security
applications, have opened up scope for direct communication.
Computerized, internet business processes have made many businesses turn to the
Internet for increased productivity, greater profitability, clutter free working conditions
and global clientèle. It is mainly due to the IT industry that people from diverse cultures
are able to personally communicate and exchange valuable ideas. This has greatly
reduced prejudice and increased sensitivity. Businesses are able to operate 24x7, even
from remote locations.
This segment revolves around automated processes that require little or no human
intervention at all. This in turn has minimized job stress levels at the work place and
eliminated repetition of tasks, loss due to human error, risks involved due to negligence
of timely upgrades and extensive paper-intensive business applications that result in the
accumulation of unnecessary bulk. The sophistication of the modern work stations and
general working conditions is possible only due to the development of Information
Technology.
Bridging the cultural gap - Information technology has helped to bridge the cultural gap
by helping people from different cultures to communicate with one another, and allow
for the exchange of views and ideas, thus increasing awareness and reducing
prejudice.
More time - IT has made it possible for businesses to be open 24 x7 all over the globe.
This means that a business can be open anytime anywhere, making purchases from
different countries easier and more convenient. It also means that you can have your
goods delivered right to your doorstep with having to move a single muscle.
Creation of new jobs - Probably the best advantage of information technology is the
creation of new and interesting jobs. Computer programmers, Systems analyzers,
Hardware and Software developers and Web designers are just some of the many new
employment opportunities created with the help of IT.
Lack of job security - Industry experts believe that the internet has made job security a
big issue as since technology keeps on changing with each day. This means that one
has to be in a constant learning mode, if he or she wishes for their job to be secure.
Dominant culture - While information technology may have made the world a global
village, it has also contributed to one culture dominating another weaker one. For
example it is now argued that US influences how most young teenagers all over the
world now act, dress and behave. Languages too have become overshadowed, with
English becoming the primary mode of communication for business and everything else.
The interchange of the words data and information is widespread, but M150 should help
you to develop a clearer understanding of the differences between the two.
Data
• Facts, statistics used for reference or analysis.
• Numbers, characters, symbols, images etc., which can be processed by a
computer.
• Data must be interpreted, by a human or machine, to derive meaning
• "Data is a representation of information" *
• Latin 'datum' meaning "that which is given"
• Data plural, datum singular (M150 adopts the general use of data as singular.
Not everyone agrees.)
Information
• Knowledge derived from study, experience (by the senses), or instruction.
• Communication of intelligence.
• "Information is any kind of knowledge that is exchangeable amongst people,
about things, facts, concepts, etc., in some context." *
• "Information is interpreted data" *