Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query gives no results when using [enter] in one of the Criteria field

Status
Not open for further replies.

bendixen

Technical User
May 3, 2007
15
US
I am running into a problem where the query gives no results when I have [enter budget reference] in the Criteria but if I hard code the same information into the Criteria line the results are produced. I'm trying to create a pop-up box so the user doesn't have to go into the query itself to change variables. All the other criteria pieces of the query work fine. Anyone understand why it's doing this and how to fix it? Thanks.

Here's the sql code...

SELECT GL_GL_DTL.ACCTG_PRD, GL_GL_DTL.ACCTG_FISC_YR, GL_GL_DTL.GL_GRANT_PGM_ELEM_CD, GL_GL_DTL.BUDGET_REF
FROM GL_GL_DTL
WHERE (((GL_GL_DTL.ACCTG_PRD)=[enter accting prd]) AND ((GL_GL_DTL.ACCTG_FISC_YR)=[enter yr]) AND ((GL_GL_DTL.GL_GRANT_PGM_ELEM_CD)=[enter program #]) AND ((GL_GL_DTL.BUDGET_REF)=[enter budget reference]));
 
did you try using only one variable at a time so that you could determine which one was causing the problem? I would start by doing that.
 
I did that. I'm thinking it must be something with the field in the table. I created another query with just this field and get the same problem.
 
What is some of your data? What are you entering when prompted by the query?

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244. Basics at
 
...
WHERE (GL_GL_DTL.ACCTG_PRD=[enter accting prd] OR [enter accting prd] Is Null)
AND (GL_GL_DTL.ACCTG_FISC_YR=[enter yr] OR [enter yr] Is Null)
AND (GL_GL_DTL.GL_GRANT_PGM_ELEM_CD=[enter program #] OR [enter program #] Is Null)
AND (GL_GL_DTL.BUDGET_REF=[enter budget reference] OR [enter budget reference] Is Null);

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top