Dear @Jen
Welcome to Microsoft Q&A Forum!
Thank you for your follow-up regarding the issue with referencing form controls in your Access queries. I appreciate your confirmation that the form is open when the query runs. Based on your description and the error message, I’d like to provide some insights and recommendations, along with official Microsoft documentation links to help you can consult for each point and see if they can help you in this case:
1.I want to state that your form must be opened and accessible. Even though the form is open, Access requires it to be actively loaded and accessible when the query runs. If the form is hidden or not fully initialized, Access may fail to resolve the reference. I found that Microsoft mentioned this behavior in the note here, you can take a look if it can help: Create a control that references a control on another form - Microsoft Support
2.Because I saw that you mentioned using Ctrl+G to open the Immediate Window. That’s a great way to test whether the form and its controls are accessible. When the Immediate Window opens, make sure you're in the VBA editor, and the form is open in Access. Also, you may try typing this in the Immediate Window:
?Forms!ProjectForm!Number1
If the control is accessible, it will return the current value. If not, it may indicate a typo or that the form/control isn't properly loaded. So, you should check it.
3.I found an idea as alternative method: if referencing form controls directly continues to cause issues, you may try using TempVars as a more stable alternative. These are global variables that can be set from the form and used in queries without requiring the form to remain open. Microsoft explains TempVars and you can consult it here: SetTempVar Macro Action - Microsoft Support
For an example usage in a query:
[TempVars]![Number1] Or [TempVars]![Number2]
4.If Access cannot resolve the form reference, it may prompt for a parameter or show an error like: "The Microsoft Access database engine does not recognize...". This typically means Access cannot find the form or control at runtime. You can take a look in these articles:
5.Microsoft also recommends using forms to collect parameters for queries, which can help streamline user input and avoid runtime errors. You can consult here: Use parameters in queries, forms, and reports - Microsoft Support
I hope this information can help you in this case and please kindly correct me if I misunderstand your concern. Wish you a pleasant day!
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.