O'Reilly logo

Microsoft® Access® 2010 Inside Out by Jeff Conrad and John Viescas

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Understanding Conditional Expressions

In some macros, you might want to execute some actions only under certain conditions. For example, you might want to update a record, but only if new values in the controls on a form pass validation tests; or you might want to display or hide certain controls based on the value of other controls. You can use an If block in macros to test conditions and then perform different actions based on the outcome of the conditional expression.

The PrintIt submacro in the DoReport macro group is a good example of a macro that uses conditions to determine which action should proceed. Right-click the DoReport macro in the Navigation pane, and then click Design View on the shortcut menu to see the Logic Designer, shown in ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required