[txt] is a value of text field in form's recordsource, or it is a value of form control (In case you didn't rename controls differently from field names. It is the reason why such renaming is adviced - otherwise Access must decide, and you may not like it's decision.);
txt is in current case a name of text type field in table, you are querying data from.
An example:
You have a field in recordsource/control on form with value [txt] = 'This is a text';
You want to get all records from table YourTable, where value of field txt is same as value of [txt]. When you know the value of [txt] you can always write the query as
Code:
SELECT * from YourTable WHERE txt = 'This is a text'
(NB! As field txt is text field, the value in WHERE condition is enclosed between "'");
Now you want the query to read the WHERE condition directly from form (from source field or from control). When you write the query as
Code:
SELECT * from YourTable WHERE txt = [txt]
you get an error, because Access is trying to run a query
Code:
SELECT * from YourTable WHERE txt = This is a text
To avoid this error, the query must be
Code:
SELECT * from YourTable WHERE txt = "'" & [txt] & "'"
When WHERE condition is numeric, then no quotes are added.
When WHERE condition is US format datestring and you want Access to interpret it as date, you use "#" (non-US format datestrings you have to convert).