form fields in a query in Acc2000

K

KPJGPM

I have one database that has the following query:

SELECT InvoiceID, Total FROM Billing WHERE
InvoiceID=[Forms]![frmMain].[txtInvoiceID]

This works fine in this database.


In another database I have the following query:

SELECT Location, LocationTotal FROM SurveyData WHERE
Location=[Forms]![frmMain].[txtLocation]

but now Access is telling me that the Jet Database Engine does not recognize
the reference to the form field as a "valid field name or expression"


Why does it work in one database and not the other?
 
J

John Vinson

I have one database that has the following query:

SELECT InvoiceID, Total FROM Billing WHERE
InvoiceID=[Forms]![frmMain].[txtInvoiceID]

This works fine in this database.


In another database I have the following query:

SELECT Location, LocationTotal FROM SurveyData WHERE
Location=[Forms]![frmMain].[txtLocation]

Try replacing the . with ! (the symbol for the membership of a
collection); and doublecheck that the name of the control is in fact
txtLocation.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top