Not Finding Record In Query Results

R

RNUSZ@OKDPS

I have a form called FRF-Search-By-Case that allows user to enter two fields:
unbtxt_SEARCH_CASE_YR and
unbtxt_SEARCH_CASE

upon entry and valid data edits, following code is executed:
------------------------ code snip begins
----------------------------------------
If DCount("*", "Filter-By-Case", "[CASE_NUM_YR]= " &
Me.[unbtxt_SEARCH_CASE_YR] & " And [CASE_NUM]= " &
Me.[unbtxt_SEARCH_CASE_NUM]) > 0 Then
MsgBox " Matching Case Records found FRF-Search-By-Case "
DoCmd.runMacro "FRM-Search-By-Case"
-------------------------- code snip ends
-----------------------------------------------

the MsgBox displays message on matching records found to user due to DCount
then runs Macro FRM-Search-By-Case which is as follows:

----------------------- macro contents begins
---------------------------------------------------
SetValue [Forms]![FRF-Search-By-Case]![unbtxt_PREV_CASE_YR]
=[Forms]![FRF-Search-By-Case]![unbtxt_SEARCH_CASE_YR]

SetValue [Forms]![FRF-Search-By-Case]![unbtxt_PREV_CASE_NUM]
=[Forms]![FRF-Search-By-Case]![unbtxt_SEARCH_CASE_NUM]

Open Form
Form Name = FRF-CR-U
View = Form
Filter Name = Null
Where Condition =
[Filter-By-Case]![CASE_NUM_YR]=[Forms]![FRF-Search-By-Case]![unbtxt_SEARCH_CASE_YR] And
[Filter-By-Case]![CASE_NUM]=[Forms]![FRF-Search-By-Case]![unbtxt_SEARCH_CASE_NUM]
Data Mode = Edit
Window Mode = Normal
------------------------------ End Macro
------------------------------------------------

Filter-By-Case Query as follows:
SELECT DPS_FR_CASE_RECORDS.CASE_NUM_YR, DPS_FR_CASE_RECORDS.CASE_NUM,
DPS_FR_CASE_RECORDS.TICKLE_DATE, DPS_FR_CASE_RECORDS.PRTNO_NUM,
DPS_FR_CASE_RECORDS.PRTD_CDE, DPS_FR_CASE_RECORDS.FR_FILE_NUM,
DPS_FR_CASE_RECORDS.TYPIST_INIT_TXT, DPS_FR_CASE_RECORDS.LIC_STAT_CDE,
DPS_FR_CASE_RECORDS.LIC_DL_STAY_CDE, DPS_FR_CASE_RECORDS.RESULT_CDE,
DPS_FR_CASE_RECORDS.RESULT_MO_CDE, DPS_FR_CASE_RECORDS.RESULT_YR_CDE,
DPS_FR_CASE_RECORDS.REVO_DATE, DPS_FR_CASE_RECORDS.OFCR_NUM,
DPS_FR_CASE_RECORDS.ACC_DATE, DPS_FR_CASE_RECORDS.CNTY_NUM,
DPS_FR_CASE_RECORDS.REQ_RECD_DATE, DPS_FR_CASE_RECORDS.HRG_DATE,
DPS_FR_CASE_RECORDS.HRG_TIME_TXT, DPS_FR_CASE_RECORDS.HRG_AM_PM_TXT,
DPS_FR_CASE_RECORDS.LOC_CDE, DPS_FR_CASE_RECORDS.ATTY_NUM,
DPS_FR_CASE_RECORDS.LIC_FIRST_NME, DPS_FR_CASE_RECORDS.LIC_MIDDLE_NME,
DPS_FR_CASE_RECORDS.LIC_LAST_NME, DPS_FR_CASE_RECORDS.LIC_SUBT_TXT,
DPS_FR_CASE_RECORDS.LIC_ADDR_TXT, DPS_FR_CASE_RECORDS.LIC_CITY_NME,
DPS_FR_CASE_RECORDS.LIC_STATE_CDE, DPS_FR_CASE_RECORDS.LIC_ZIP_CDE,
DPS_FR_CASE_RECORDS.LIC_ZIP4_CDE, DPS_FR_CASE_RECORDS.LIC_DL_NUM,
DPS_FR_CASE_RECORDS.SECURITY_AMT, DPS_FR_CASE_RECORDS.DOA_NME,
DPS_FR_CASE_RECORDS.DOA_ADDR_TXT, DPS_FR_CASE_RECORDS.DOA_CITY_NME,
DPS_FR_CASE_RECORDS.DOA_STATE_CDE, DPS_FR_CASE_RECORDS.DOA_ZIP_CDE,
DPS_FR_CASE_RECORDS.DOA_ZIP4_CDE, DPS_FR_CASE_RECORDS.FLAG_CDE,
DPS_FR_CASE_RECORDS.BATCH_DATE, DPS_FR_CASE_RECORDS.BATCH_NUM,
DPS_FR_CASE_RECORDS.MEMO1_TXT, DPS_FR_CASE_RECORDS.MEMO2_TXT,
DPS_FR_CASE_RECORDS.MEMO3_TXT, DPS_FR_CASE_OTHERS.SEQ_NUM,
DPS_FR_CASE_OTHERS.VEHICLE_CDE, DPS_FR_CASE_OTHERS.OTHER_CDE,
DPS_FR_CASE_OTHERS.OTHER_NME, DPS_FR_CASE_OTHERS.FIRM_NME,
DPS_FR_CASE_OTHERS.OTHER_ADDR_TXT, DPS_FR_CASE_OTHERS.OTHER_CITY_NME,
DPS_FR_CASE_OTHERS.OTHER_STATE_CDE, DPS_FR_CASE_OTHERS.OTHER_ZIP_CDE,
DPS_FR_CASE_OTHERS.OTHER_ZIP4_CDE, DPS_FR_CASE_OTHERS.UPDATED_DATE
FROM DPS_FR_CASE_RECORDS LEFT JOIN DPS_FR_CASE_OTHERS ON
(DPS_FR_CASE_RECORDS.CASE_NUM = DPS_FR_CASE_OTHERS.CASE_NUM) AND
(DPS_FR_CASE_RECORDS.CASE_NUM_YR = DPS_FR_CASE_OTHERS.CASE_NUM_YR);

-------------------- End Query SQL View ---------------------

Even though a matching record exists in results set, and user enters key
numbers
the results are not located, and the results is the application throws up a
pop-up box and asks user for Filter-By-Case!CASE_NUM_YR value to be
entered instead of accepting that of owner form.

Then asks user for Filter-By-Case!CASE_NUM the second field that was
supplied on form. I evidently need to code the Where condition differently
but do not quite understand what should be used, could someone assist please
in identifying the error in the Where Condition !

Thanks in advance
 

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

Top