Share via

The Microsoft Access Database Engine does not recognize...

Anonymous
2010-11-22T22:43:33+00:00

Forms![Inventory Reports]![SupplierName]  as a valid field name or expresion.

This is a combo box on an open form, it has a selection chosen in that combo box, and I put the name of that combobox into the criteria section of the query grid using "build," go to forms, choose form, choose combo box, so I know it is spelled correctly.

Isn't this like the simple stuff that is just supposed to work?

What am I missing?

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

HansV 462.6K Reputation points
2010-11-23T15:10:28+00:00

Ah! It is a crosstab query. You need to declare the parameter explicitly. You can do this in two ways:

  1. Open the query in design view.

Click Parameters in the Show/Hide section of the Design tab of the ribbon.

Enter [Forms]![Inventory Reports]![SupplierName] in the Parameter column and Text in the Data Type column, then click OK.

  • or -
  1. Insert the following line at the top in SQL view (this line must come before the existing SQL string):

PARAMETERS [Forms]![Inventory Reports]![SupplierName] Text (255);

Was this answer helpful?

70+ people found this answer helpful.
0 comments No comments

10 additional answers

Sort by: Most helpful
  1. Anonymous
    2012-10-07T17:07:17+00:00

    I tried this and it did not resolve my problem.

    I tried adding the parameter in both the originating query and the crosstab query but I still get the error message.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2010-11-23T00:14:08+00:00

    Post the SQL where it is used and gives the error.


    Build a little, test a little.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  3. HansV 462.6K Reputation points
    2010-11-22T22:51:42+00:00

    Does your combo box happen to be on a subform? If so, you'd have to use

    Forms!Mainformname!Subformname!SupplierName

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  4. Anonymous
    2010-11-22T23:06:03+00:00

    Nope.  One form, has about 20 buttons and 8 combo boxes.  The buttons run queries, and many of them use one or more combo boxes the same way, and they work fine...

    Was this answer helpful?

    0 comments No comments