If I may add to the explanation, what you are doing is concatenating. You will need to develop a mindset around how this works lest you continually stumble. So, try thinking of it this way:
you have to assemble (concatenate) all the parts into something that Access can understand. These parts are divided into two types - the string (text) that makes up the program language syntax of the statement (enclosed in quotes) that you are trying to build AND the parts you want to pass to Access as variables or parameters/criteria. If you were to write
"SELECT * FROM tblMyTable;", no other quotes are necessary since that constitutes an entire valid syntax statement - there are no variables or parameters. However, if you want to include filter criteria, you must separate the syntax parts from the variables (in your mind) and assemble (concatenate them) in a way that Access can resolve.
So with criteria:
The program language syntax part --"SELECT * FROM tblMyTable WHERE Customer = ' " (extra space for visibility)
The concatenated criteria value coming from a control named txtCust -- (which MUST be enclosed in quotes [i.e. delimited] if is text)
The concatenated syntax ending " ';"
NOTE - the concatenation operator (&) must be used, as you probably already know
The full concatenation: "SELECT * FROM tblMyTable WHERE Customer = ' " & Forms!frmMyForm.txtCust & " ';"
Everything between the quotes is concatenated AND the variable/reference is substituted for whatever it equals (e.g. ABC INC.) and the result is:
SELECT * FROM tblMyTable WHERE Customer = 'ABC INC.';
Hope that helps you get your mind around how it works. Don't worry - you will mess up again (I do!). You can always output your concatenation in the immediate window of the vb editor and see the output, or copy/paste into a new query in sql view, which has the advantage of usually pinpointing the error when you try to run it.
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.