Strange query issue

I added a criteria to a query design field that looks like:

Between [Forms]![frmFormName]![txtStartDate] and [Forms]![frmFormName]![txtEndDate]

The field I added it to was from a table named G which I am assuming is a temporary table or query or an alias or something.  Then I ran the query and the results were what I expected them to be so I closed the query.  When I re-opened it the criteria was gone but the functionality is still there.  In other words when I open the form, frmFormName and enter the two dates the query returns what I expect but the criteria is not showing.

What is going on?
SteveL13Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rey Obrero (Capricorn1)Commented:
open query in design SQL view, copy the SQL and paste here
0
Hamed NasrRetired IT ProfessionalCommented:
Check Rey's comment first.

Show a snapshot of the query design.
0
SteveL13Author Commented:
You asked for it...  Here is it.  Very complicated.  I did not create it, all I did was add the date criteria as presented in my post.

SELECT G.WO_REC_ID, RELREP_PM_PROGRAM.PROGRAM_INIT, G.PROGRAM_YEAR, IIf([G].[CARRY_OVER]=True,"Y","N") AS CARRY_OVER, DLookUp("OPERATING_CODE_DESC","IRS_LTS_REGION_DMC_MAP","OPERATING_CODE='" & [OP_REGION_CODE] & "'") AS OPERATING_CODE_DESC, IRS_DMC.DMC_NAME, G.AREA, G.WORK_ORDER_NBR, G.SR, RELREP_PM_BUDGET_LABOR.ITN, G.FEEDER, G.DEVICE, IIf([FEEDER_FUSE]=1,"M",IIf([FEEDER_FUSE]=2,"F",Null)) AS ML_FUSE, IIf([G].[ON_CUST_TRGT]=True,"Y","N") AS ON_CUST_TRGT, IIf([G].[ON_ONE_PERCENT]=True,"Y","N") AS ON_ONE_PERCENT, G.CYCLE, G.COMMITMENT_DATE, G.PRELIM_AMT_EST, G.PM_ASSIGNED_DATE, G.OUTAGE_NO, G.SCOPE, CC.COMPANY AS CONST_COMPANY, CS.STATUS AS CONST_STATUS, ES.STATUS AS ENG_STATUS, EC.ENG_DESIGN_COMPNY AS ENG_COMPANY, RELREP_PM_CONSTRUCTION.CNSTRCTN_START_DT_EST, RELREP_PM_CONSTRUCTION.CNSTRCTN_CMPL_DT_EST, RELREP_PM_CONSTRUCTION.CNSTRCTN_START_DT_ACT, RELREP_PM_CONSTRUCTION.CNSTRCTN_CMPL_DT_ACT, RELREP_PM_CONSTRUCTION.ELEC_CMPL_DT_ACT, RELREP_PM_CONSTRUCTION.CNSTRCTN_BID_WAVE, G.PROGRAM_ID, RELREP_PM_CONSTRUCTION.CNSTRCTN_CMPNY_ID, G.OP_REGION_CODE, E.ENG_STATUS_ID, E.REL_ENG_ID, E.ENG_DESIGN_COMPNY_ID, RELREP_PM_CONSTRUCTION.CNSTRCTN_STATUS_ID, G.TOWN_ID, E.DESIGN_DUE_DATE, E.DESIGN_ISSUED_DT, E.POLE_COUNT, RELREP_PM_BUDGET_LABOR.MAT_EST_PER_UNIT_LBR_COST, RELREP_PM_BUDGET_LABOR.MAT_EST_PER_UNIT_LBR_MAT_COST, G.FEEDER_FUSE, G.PRIORITY_LIST_ID, RELREP_PM_PRIORITY_LIST.PRIORITY_ORDER, IIf([EASEMENT_REQUIRED]=True,'Y') AS EASEMENT_REQ, IIf([EASEMENT_RECEIVED]=True,'Y') AS EASEMENT_REC, G.EXT_AFFAIRS_MNGR_ID
FROM (((((RELREP_PM_GENERAL AS G LEFT JOIN IRS_DMC ON G.BARN_ID = IRS_DMC.DMC_ID) LEFT JOIN RELREP_PM_PROGRAM ON G.PROGRAM_ID = RELREP_PM_PROGRAM.PROGRAM_ID) LEFT JOIN RELREP_PM_PRIORITY_LIST ON G.PRIORITY_LIST_ID = RELREP_PM_PRIORITY_LIST.PRIORITY_LIST_ID) LEFT JOIN RELREP_PM_BUDGET_LABOR ON G.WO_REC_ID = RELREP_PM_BUDGET_LABOR.WO_REC_ID) LEFT JOIN ((RELREP_PM_CONSTRUCTION LEFT JOIN RELREP_PM_COMPANY AS CC ON RELREP_PM_CONSTRUCTION.CNSTRCTN_CMPNY_ID = CC.COMPANY_ID) LEFT JOIN RELREP_PM_STATUS AS CS ON RELREP_PM_CONSTRUCTION.CNSTRCTN_STATUS_ID = CS.STATUS_ID) ON G.WO_REC_ID = RELREP_PM_CONSTRUCTION.WO_REC_ID) LEFT JOIN ((RELREP_PM_ENGINEERING AS E LEFT JOIN RELREP_PM_STATUS AS ES ON E.ENG_STATUS_ID = ES.STATUS_ID) LEFT JOIN RELREP_PM_COMPANY_ENG AS EC ON E.ENG_DESIGN_COMPNY_ID = EC.ENG_DESIGN_COMPNY_ID) ON G.WO_REC_ID = E.WO_REC_ID;

Open in new window

0
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

Rey Obrero (Capricorn1)Commented:
I don't think this is the query that is using the
[txtStartDate] and [txtEndDate]  as  criteria


post the actual name of the form and controls.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Hamed NasrRetired IT ProfessionalCommented:
Now you have an issue of WHERE clause. The query, as you mentioned, is complicated.

"but the criteria is not showing"
Try to check the criteria on an obvious field in the query, for example: G.PROGRAM_YEAR

G is an alias of a table as specified in FROM clause : RELREP_PM_GENERAL AS G
0
SteveL13Author Commented:
I posted the wrong SQL and found the right one.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.