Hi Aubrey,
Thanks for the nice comments on my book.
For your macro variable question the answer depends on the context.
In Access 2013 web apps, if you define a variable in a UI macro at the view level using the SetVariable macro action, the value will live on for the entire time you are using the app in the browser. The variable can be carried/referenced by other views in the app just fine. You can use it for example in control sources and even in other UI macros. However, the variable will be lost if the user closes their browser tab/window of the app or if they do a hard page refresh (F5). So just bear that in mind.
For data macros, the standard SetLocalVar action can be used to define a variable. However, those variables only exist within the lifetime of the event or macro logic being executed. Once the data macro logic completes, the variable is gone.
For named data macros, you can define what are called Return Variables (SetReturnVar). A variable defined here can be referenced from the calling macro. So a named data macro could pass around a variable between other named data macros. Also a UI macro could call a named data macro to get some values, and those values could be bubbled up from the data layer to the UI layer using return variables. Once brought back to the UI macro, you assign those values to variables which could be used in other areas of the app at the UI layer.
I hope that helps answer your question.
--------------------
Jeff Conrad - Access Junkie - MVP Alumnus
Senior Content Developer - Modern Assistance and Support Experience - Microsoft Corporation
Author -
Microsoft Access 2013 Inside Out
Author -
Microsoft Access 2010 Inside Out
Co-author -
Microsoft Office Access 2007 Inside Out
Access 2007/2010/2013 Info:
http://www.AccessJunkie.com
----------
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/en-us/legal/Copyright/Default.aspx
----------