form fields in a query in Acc2000

  • Thread starter Thread starter KPJGPM
  • Start date Start date
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?
 
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.
 
Back
Top