Kevin,
Go to the "Modules" tab in Access; create a new module.
Create a global variable - Instead of Dim, type Global - (the value of a
global variable can be set anywhere in the application). Create a function
in the same module (the function can be called from anywhere in the
application).
In the new module:
Option Compare Database
Global gStr As String 'global variable
Function fstr() As String 'function name
fstr = gstr 'function will equal the variable
End Function
Save the module. I usually just name my "Code" or "modCode".
In your form code, set the global variable to your parameter in whatever
action in the form gets the data, such as an On Click event.
gStr = Me.yourformfielddata
Open your query, and in field that needs the parameter, type in the function
name in the "Criteria" property
fstr()
When the query runs, it will automatically call the function. As long as
the value of the variable has been set in the form first, the function will
equal that variable and it should work.
Functions return a value. In this case, the function is set to the value of
the variable.
I hope this helps.