See the [forms]!me![customerid] in the snippet of VBA beneath.
It gives an error ... the "me" bit is the problem.
How do I simply refer to the form I am "currently on".
(Note I do not want to hard code the name of the form).
If DCount("CustomerID", "tblDetail", "WindowCode='999' and customerid = [forms]!me![customerid]"