Referencing variables in queries

  • Thread starter Thread starter MattLe
  • Start date Start date
M

MattLe

I can set values for variables, but I can't figure out how
to call that variable from within queries or forms.

Seasonal start and end dates stored as variables, how do I
reference that in the criteria field of "RegisteredDate"
field in my query to only show dates between the start and
end dates.

Thank you.
 
MattLe said:
I can set values for variables, but I can't figure out how
to call that variable from within queries or forms.

Seasonal start and end dates stored as variables, how do I
reference that in the criteria field of "RegisteredDate"
field in my query to only show dates between the start and
end dates.


VBA variables are only available in VBA modules. You can
use Public Function (not Sub) procedures in standard modules
anywhere though. Putting that together means that you can
create a "wrapper" function for each variable that just
returns the variable's value.

You may find it easier/better to use hidden form text boxes
instead of variables.
 
Back
Top