R
RNUSZ@OKDPS
What is the proper way to VB code for executing a Select Query via an access
form when the form prompts user to enter record key data and you want to read
a table and its alternate/secondary table for matching records. Would I use
DCount or Count function to obtain the number of matching records found in
both tables and could someone suggest the VB code for the DCount or Count
function, I'v tried and not had much luck in obtaining the number of records
in temporary result set.
The following is the code from a Query that would have to be executed in
order to obtain the record information via form input:
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
FROM DPS_FR_CASE_RECORDS
WHERE
(((DPS_FR_CASE_RECORDS.CASE_NUM_YR)=[Forms]![FRF-Search-By-Case]![unbtxt_SEARCH_CASE_YR])
AND
((DPS_FR_CASE_RECORDS.CASE_NUM)=[Forms]![FRF-Search-By-Case]![unbtxt_SEARCH_CASE_NUM]));
Thanks in advance
form when the form prompts user to enter record key data and you want to read
a table and its alternate/secondary table for matching records. Would I use
DCount or Count function to obtain the number of matching records found in
both tables and could someone suggest the VB code for the DCount or Count
function, I'v tried and not had much luck in obtaining the number of records
in temporary result set.
The following is the code from a Query that would have to be executed in
order to obtain the record information via form input:
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
FROM DPS_FR_CASE_RECORDS
WHERE
(((DPS_FR_CASE_RECORDS.CASE_NUM_YR)=[Forms]![FRF-Search-By-Case]![unbtxt_SEARCH_CASE_YR])
AND
((DPS_FR_CASE_RECORDS.CASE_NUM)=[Forms]![FRF-Search-By-Case]![unbtxt_SEARCH_CASE_NUM]));
Thanks in advance