Query Error Message

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need help in identifying why I am getting this message. I have a query for
a Report where my defined field returns the message that says:
**The Microsoft Jet database engine does not recognize -
'Forms![Level-Top-Reports]!DivID!' as a valid field name or expression.**

My query has the following field in one line:
SpcCode: IIf(DMax("[GrpNo]","Group","[DivID]=" &
([Forms]![Level-Top-Reports]![DivID]))>"A" Or
DMax("[GrpNo]","Group","[DivID]=" &
([Forms]![Level-Top-Reports]![DivID]))>"1",[GrpNo] & "." & [ccnumber] & "." &
[RoomOrder],[ccnumber] & "." & [RoomOrder])

The reason why I need help is because I have exactly the same field in other
reports and they run without any problems.
 
Yes, it is open.

Ofer Cohen said:
Is the form Level-Top-Reports open?

It's need to run for the query to recognize it

--
Good Luck
BS"D


Martin said:
I need help in identifying why I am getting this message. I have a query for
a Report where my defined field returns the message that says:
**The Microsoft Jet database engine does not recognize -
'Forms![Level-Top-Reports]!DivID!' as a valid field name or expression.**

My query has the following field in one line:
SpcCode: IIf(DMax("[GrpNo]","Group","[DivID]=" &
([Forms]![Level-Top-Reports]![DivID]))>"A" Or
DMax("[GrpNo]","Group","[DivID]=" &
([Forms]![Level-Top-Reports]![DivID]))>"1",[GrpNo] & "." & [ccnumber] & "." &
[RoomOrder],[ccnumber] & "." & [RoomOrder])

The reason why I need help is because I have exactly the same field in other
reports and they run without any problems.
 
Is the report's query a cross-tab query. If so, you must declare the
parameter in the query.

First thing, with a crosstab query you MUST declare your parameters and
if any other queries are used in the crosstab their parameters must also
be declared.

Open the query in design mode
Select Query: Parameters from the Menu
Fill in the EXACT name of the parameter in column 1
Select the data type of the parameter in column 2
 
John,

You are correct. I declared the [Forms]![Level-Top-Reports]![DivID]
parameter as you described below and worked like a charm. The query was not a
crosstab query but has a crosstab query as one of the sources. I noticed that
if I deleted the crosstab query as one of the sources for two fields, the
query had no problems displaying the results. The expression I had was not
referencing to any values of the crosstab query.

Is there any simple explanation of why this needs to happen with crosstab
queries?

Thank you.

Martin
 

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

Similar Threads

Count and assign 2
Query calculated field question 2
Problems with Forecast Query 1
Help with a query 3
Calculations within a query 5
Query Criteria Not Working 2
DSum in Query 1
dsum in query 3

Back
Top