Problem with calling function from query

croftpw

New member
Local time
Yesterday, 22:22
Joined
Aug 3, 2011
Messages
3
I have a query that calls a function to return a value for a Criteria, but the function is located in a form -- and the query doesn't recognize it immediately when I load the form.

I tried moving the function to a module, but then some of the code in the function calls a Combo box in the form, and it says I can't call on it outside of the control.

Any ideas?
 
So, I figure I have to put the function being called by the query in at a higher level, so I put it back into the module. But then I get this error message:

"You can't reference a property or method for a control unless the control has the focus."

And it's referring to the line:
If Form_Main.Combo21.Text = "All" Then
Evidently, I can't refer to a form control from a module? Please advise. Thank you.
 

Users who are viewing this thread

Back
Top Bottom