Microsoft Access Macros tutorials
I've been trying to make a macro conditional that attempts to find a record in query X and if no such record exists, to go to form Y, however, if a record does exist, go to form Z. If I only want form X opened if such a record does not exist, wouldn't I use a conditional to cross reference the entry on a form "A" with the selected field after the FINDRECORD?? Is there an easier way?
Related Tutorials
Microsoft Access Macro Conditions
In this article, we're going to create a conditional macro - that is, a macro that only launches when certain criteria are met. There's no VBA involved, it's all strictly through the Access interface.
Store the date and time when a record is modified
You can keep track of when records in a table are last modified, by using a form with a macro. When the form is used to modify a record, the macro stores the date and time in the table. Only the most recent modification date and time are stored. In this article * Overview * Before you begin * Step 1: Add timestamp fields to a table * Step 2: Create a macro that records the date and time * Step 3: Add the macro to a data-entry form
Create conditional (Boolean) expressions
This article explains how to create conditional (also known as Boolean) expressions. A conditional expression evaluates to either true or false, and it then returns a result that meets the condition that you specify. If you use functions in your conditional expressions, you can also specify an action for values that do and do not meet the condition in the expression. For example, you can create an expression that finds all sales with a profit margin of 10 percent or less, and then specify that those numbers appear in red type, or replace the values with a message. In this article * Understand conditional expressions * Create a conditional expression * Examples of conditional expressions
Macros - Use Macros to automate your work in Access!
If you find yourself doing the same routine task over and over again, you might want to consider creating a macro to complete the task for you. A macro helps you perform routine tasks by automating them. Instead of manually performing a series of time-consuming, repetitive actions, you can record a single macro that does the entire task all at once for you.
Event-Driven Programming Using Macros
Learn: What is event-driven programming? What is a trigger? How do I design a trigger? How does the macro editor in Access work? How do I attach a macro to an event? What is the SetValue action? How is it used? How do I make the execution of particular macro actions conditional? What is a switchboard and how do I create one for my application? How to I make things happen when the application is opened? What are the advantages and disadvantages of event-driven programming? (pdf file, install Acrobat Reader to read this tutorial.)
Using Macros to Automate Data Entry
As you will have seen in the previous topic, we can use Macros to Require Data Entry and to inform users of any errors made in the data entry routine. We can also use Microsoft Access Macros to speed up the process of data entry. We can use a macro to remove the need for a user to enter the same data over and over for each record, we can use a macro to automate this process. A Microsoft Access macro is a database object that allows us to automate repetative tasks without having to write complex programming routines. In Access, these tasks that the macro performs are know as macro actions.
RunMacro Macro Action
You can use the RunMacro action to run a macro. The macro can be in a macro group. You can use this action: -To run a macro from within another macro. -To run a macro based on a certain condition. -To attach a macro to a custom menu command.
GoToRecord Macro Action
You can use the GoToRecord action to make the specified record the current record in an open table, form, or query result set.
Change the appearance of a control by using conditional formatting
Conditional formatting allows you to selectively highlight certain data on your form or report so that it is easier to understand. For example, you might want to format negative numbers in a red font to make it clear that those records need further attention. You can set conditional formatting for a text box or a combo box control. You can change the formatting based on the control's own value, or you can use an expression to change the formatting based on the values contained in other fields or controls. On a form, you can use conditional formatting to disable a control, and you can cause the formatting of a control to change when the cursor is positioned in that control. What do you want to do?: *Apply conditional formatting to a control based on its own value *Use an expression to apply conditional formatting to one or more controls *Change the formatting of a control on a form that has the focus *Remove conditional formatting from one or more controls *Create alternating row colors on a report
Copy or move a control or other item
You can copy or move items such as fields, controls, text, or macro actions. When you copy a field, control, or macro action, Microsoft Access includes any associated properties, controls, or action arguments. For example, when you copy a text box control, Access copies its label as well. When you copy a macro action by clicking the row selector, Access copies the associated action arguments, macros, and conditional expressions. However, Access doesn't copy event procedures associated with a control.
FindRecord Macro Action
You can use the FindRecord action to find the first instance of data that meets the criteria specified by the FindRecord arguments. This data can be in the current record, in a succeeding or prior record, or in the first record. You can find records in the active table datasheet, query datasheet, form datasheet, or form.
Create a macro
You can create a macro (macro: An action or set of actions that you can use to automate tasks.) to perform a specific series of actions (action: The basic building block of a macro; a self-contained instruction that can be combined with other actions to automate tasks. This is sometimes called a command in other macro languages.), and you can create a macro group (macro group: A collection of related macros that are stored together under a single macro name. The collection is often referred to simply as a macro.) to perform related series of actions. In Microsoft Office Access 2007, macros can be contained in macro objects (sometimes called standalone macros), or they can be embedded into the event properties of forms, reports, or controls. Embedded macros become part of the object or control in which they are embedded. Macro objects are visible in the Navigation Pane, under Macros; embedded macros are not. What do you want to do?: Learn about the Macro Builder, Create a standalone macro, Create a macro group, Create an embedded macro, Edit a macro, Use conditions to control macro actions, Learn more about macro actions.
Creating and Using Macros
As you work more with Access, you will discover many ways you can tailor your Access environment to your needs. One of the ways Access lets you simplify tasks is with macros. In short, a macro is a recording of the steps you perform to accomplish a specific task. For example, to print a table, you select the File menu Print option and then choose OK within the Print dialog box. Using an Access macro, you record these steps. Later, you can play back your macro and Access will automatically perform the steps for you. As you will learn, you can write macros that perform simple or complex tasks.
Hourglass Macro Action
You can use the Hourglass action to change the mouse pointer to an image of an hourglass (or another icon you've chosen) while a macro is running. This action can provide a visual indication that the macro is running. This is especially useful when a macro action or the macro itself takes a long time to run.
Highlight values on a report by using conditional formatting
This video walks you through the process of applying conditional formatting to a column of numbers on a report. By using conditional formatting, you can highlight specific values automatically, making your report easier to understand.
Run an Access macro by using a keyboard shortcut
You can assign an action (action: The basic building block of a macro; a self-contained instruction that can be combined with other actions to automate tasks. This is sometimes called a command in other macro languages.) or set of actions to a specific key or keyboard shortcut by creating an AutoKeys macro group (macro group: A collection of related macros that are stored together under a single macro name. The collection is often referred to simply as a macro.). When you press the key or keyboard shortcut, Microsoft Office Access performs the action.
Recording the date and time when a record is modified in Access
When you use a form to edit records, you can add a date and time stamp to a record by attaching a macro to the BeforeUpdate form property, or by writing an event procedure for the BeforeUpdate form event.
Create a Macro
Microsoft Access provides the ability for you to create macros. A "macro" refers to a set of actions that can be run automatically, and on demand. You could make a macro run when a user presses a certain key, or you could make a macro run everytime your database is opened.
Test a macro by using Single Step mode
By single stepping (single stepping: A debugging technique that enables you to run a macro one action at a time or run Visual Basic code one line at a time.) through a macro (macro: An action or set of actions that you can use to automate tasks.), you can observe the flow of the macro and the results of each action (action: The basic building block of a macro; a self-contained instruction that can be combined with other actions to automate tasks. This is sometimes called a command in other macro languages.), and isolate any action that causes an error or produces unwanted results. (Applies to Microsoft Office Access 2007)
MsgBox Macro Action
You can use the MsgBox action to display a message box containing a warning or an informational message. For example, you can use the MsgBox action with validation macros. When a control or record fails a validation condition in the macro, a message box can display an error message and provide instructions about the kind of data that should be entered.
Jump Start VBA Skills with MS Access Macros
Macros help to speed up the performance of certain repetitive tasks when using an application. They are used extensively in all office-related software. As a programmer, you can leverage the built-in macro object in MS Access to get a head start in understanding VBA. This article explains how. TOC: Jump Start VBA Skills with MS Access Macros; Creating and running a macro in MS Access: opening the macro designer; Creating the first macro; Converting this macro to VBA code; Creating the second macro.
Introduction to Record Sets
Topics: The Type of Recordset Objects, Creating a Recordset Object, Characteristics of a Record Set, Opening a Record Set, Record Navigation in a Record Set, The Fields of a Recordset.
Access/VBA Tutorials
When a record is deleted from a form's recordset, then bookmarks are used to go to another record more than 262 records away from the deleted one, it appears as though the record with the correct ID is being edited, but in fact a record offset positively from that one number of records deleted) is actually edited. What you see is NOT what you get - the wrong record is edited.
Create a macro that runs when you open a database
If you want to perform a particular set of actions every time that a database starts, you can create an AutoExec macro. For example, you might want to maximize the database window, lock the Navigation Pane, and then open a particular report. An AutoExec macro is just a macro that is named AutoExec. When a database starts, Access runs the AutoExec macro before it runs any other macros or VBA code. (Applies to: Microsoft Office Access 2007)
Introduction to macros
This article explains what macros are and how they can save you time by automating tasks that you perform often. It explores the fundamentals behind creating and using macros and also touches on improvements to macros in Microsoft Office Access 2007. In this article: What is a macro? Understand macros; New macro features in Office Access 2007; Create a macro; Run a macro.
Introduction to macros
This article explains what macros are and how they can save you time by automating tasks that you perform often. It explores the fundamentals behind creating and using macros and also touches on improvements to macros in Microsoft Office Access 2007. In this article you'll learn: What is a macro? Understand macros, New macro features in Office Access 2007, Create a macro, Run a macro.
SingleStep Macro Action
You can use the SingleStep action to pause macro execution and open the Macro Single Step dialog box.
SearchForRecord Macro Action
You can use the SearchForRecord action to search for a specific record in a table, query, form or report.
Save a record
Microsoft Access automatically saves the record you are adding or editing as soon as you move the insertion point to a different record, or close the form or you are working on...
Conditional Formatting In Forms And Reports
Add various colored text and other formatting to forms and reports in your database, depending upon which conditions are met, even without the conditional formatting feature provided by Microsoft Access 2000 and later versions.
CancelEvent Macro Action
You can use the CancelEvent action to cancel the event that caused Microsoft Office Access 2007 to run the macro containing this action. The macro name is the setting of an event property such as BeforeUpdate, OnOpen, OnUnload, or OnPrint.
Refreshing data on a child one-many form
I have a one to many relationship on a form/subform. I have buttons on the subform that basically will automatically add a new record to the table the subform is based on. I am using the sql "insert" clause to add the record - which it is dong just fine. However, I have tried the .refresh and .requery commands and neither seem to be able to display the new record automatically in the list. I have to exit the screen and come back in before the new record is displayed. WHat method can I use to cause the new record to be displayed on the child form right away?
Conditional formatting in Access 2003/XP/2000/97
Question: In Access 2003/XP/2000/97, how can I apply a conditional format on a text box? I want to change the background color to blue when the text box has focus. How do I do this?
How to: Determine Whether The Current Record is a New Record In a Form
Learn how to use the NewRecord property to determine if the current record is a new record.
Microsoft Access Multi-User Application Record Locking
Record locking occurs in two environments, the Microsoft Access Interface and the ADO Recordset Object. We have already established that record locking is in effect mostly in network shares. But what is record locking exactly? Well it is a mechanism that locks records when they are being edited by a particular user so that other users cannot edit them.
Outputting one HTML file per record in an Access database
There are several ways to make your Access data available on the Web. Usually, Access displays more than one record per Web page. For example, when you create a data access page, you can browse and modify all records in the record set from one Web page. Or, when you output a datasheet to an HTML or XML file, all the records are formatted as one HTML table. However, there are times when you want to output one HTML file per record. Learn: Why output one HTML file per record in an Access database? How many ways in Access can I output one HTML file per record? Use a report to output one HTML file per record. Use the VBA PRINT statement to output one HTML file per record.
AutoExec Macro in Microsoft Access
In Microsoft Access you can use startup options to specify, for example, what form to display, whether toolbars can be customized, and whether shortcut menus are available in your Microsoft Access file. You can also use a special macro named AutoExec to carry out an action or series of actions when your database first opens. When you open a database, Microsoft Access looks for a macro with this name and, if it finds one, runs it automatically.
How to: Move Through a DAO Recordset
A Recordset object usually has a current position, most often at a record. When you refer to the fields in a Recordset, you obtain values from the record at the current position, which is known as the current record. However, the current position can also be immediately before the first record in a Recordset or immediately after the last record. In certain circumstances, the current position is undefined. Describes how to use the Move methods to navigate a recordset.
How to: Return a Random Record from a DAO Recordset
Microsoft Access does not have a built-in mechanism for returning a random record from a set of records. This topic describes a sample user-defined function that you can use to return a random record.
Using Conditional Formatting to Highlight records
This tutorial will describes how to Use Conditional Formatting to Highlight records. (video tutorial)
 
Categories