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?
 
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
 
Rey Obrero (Capricorn1)Commented:
open query in design SQL view, copy the SQL and paste here
0
 
hnasrCommented:
Check Rey's comment first.

Show a snapshot of the query design.
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
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
 
hnasrCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.