| ||||||
|
Open Email Using SendObject Access Download Send Email Microsoft Access Tutorial Download (Advanced) Multi Select List Box Query Parameters Programming MS Access Security Alternative Single User Inventory Calculations Download How To Perform Multi-User Inventory Calculations Make Dependent Combo Box Code MS Access Tutorial Download Union Query (Advanced) Access Tutorial Download How To Fill Fields From Combo Box Use Global Variables as Parameters Download Continuous Form Dependent Combo Box How To Program Continuous-Continuous Master/Detail Forms Bar Chart / Bar Graph Download Programming Crosstab Query Example TransferText & OutputTo Microsoft Access Download DoCmd.OpenForm & OpenArgs VBA Example |
Visual Basic Global Variables as Query ParametersUsing global variables to pass user selection criteria to queries is a useful programming technique to master. This Access download will provide you
with all the forms, modules, queries and VBA code to get you started.
In the code above, get_global is a custom query function that passes back the value of any global variable you have defined. In this case we are retrieving the GBL_Student_ID which was previously selected as a parameter in the form below. Note that you can create and use custom VBA functions in queries just as you use custom public functions in regular VBA code. These custom function can perform complex recordset operations that are not normally available in access queries. Complex scalar functions can be implemented with simple VBA custom functions. The get_global function is just a simple example of these query functions. There are other methods for returning global variables, such as the Eval function, however we find this custom method more reliable and flexible.
Give our
Global Variables as Query
Parameters downloadable Access example a try. See the following additional in-site resources for global variables:
VBA Global Variables
Query Parameters and Parameter Query in Access
Visual Basic Global
Variables as Query Parameters
|
|
|
Contact Information Copyright 2000-2012 Blue Claw Database Design, LLC
|