A
Anthony
Is it possible to pass a VBA Variable Value into the criteria section of a
field in a query? (In design mode)
field in a query? (In design mode)
Anthony said:Is it possible to pass a VBA Variable Value into the criteria section of a
field in a query? (In design mode)
Norm said:Hi Anthony
In your VBA code create a function like the following one. VariableName
is
your VBA variable.
Function FunctionName()
FunctionName = VariableName
End Function
In design mode of your query, right mouse click in the criteria box you
wish
to use your function variable in. Select 'Build' option in the popup.
Click
on 'Functions' to expand the list of functions. Select the VBA module
your
function resides in. Your function should be listed in the right most
column. Double click it and OK. Bubda bing budda boom, your variable is
the
criteria for your query.
For kicks click on the SQL view mode for your query (instead of Design
View)
to see what the SQL code looks like.
Hope this helps
Norm