The error is often caused by a misspelled object (form control, table or field name, form name, etc.). If you've validated all such reference names, then often, the other culprit is that coded sql can't be processed the same way as is done by the query side of things. In those cases, it's usually a form field reference that can't be resolved. Assuming the form is open, then there are 2 approaches that I know of. One is to declare and define all the parameters (google MS Access qdef.parameters). A simpler way that works for me is to declare a variable for the parameter and use that in the sql statement instead. So, vba can define what Me.txtMyTextbox is and then assign it to strMyString, and vba can then deal with
...WHERE tblVisit.VisitID = '" & strMyString & "'"...
Having said that, I'm surprised the message was about 1 parameter when you have 2 references. Makes me think it is a spelling problem.
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.