Y
yator
How would I return a subset of records if a form check box is checked but
return all records if the check box is blank.
The formcheck box is: [Forms]![frm_switchboard]![chk_rndm]
The field [RandomMarker] can have the values of "Y" or Null only.
The following SQL pulls the correct data when the check box is checked, but
I recive an "OpenForm action was canceled" when the box is blank. How would I
modify the query to pull all results ([RandomMarker]="Y" or Null) when the
box is not checked?
SELECT tbl_tt_trans.TransNo, tbl_tt_trans.Fac, tbl_tt_trans.CODE,
tbl_tt_trans.RandomMarker, tbl_tt_trans.UseDT, tbl_tt_trans.TransNo
FROM tbl_tt_trans
WHERE (((tbl_tt_trans.CODE)=[Forms]![frm_switchboard]![swCode]) AND
((tbl_tt_trans.RandomMarker)=[Forms]![frm_switchboard]![chk_rndm]) AND
((tbl_tt_trans.PtType) Not Like "O"))
ORDER BY tbl_tt_trans.UseDT;
thanks for the help
return all records if the check box is blank.
The formcheck box is: [Forms]![frm_switchboard]![chk_rndm]
The field [RandomMarker] can have the values of "Y" or Null only.
The following SQL pulls the correct data when the check box is checked, but
I recive an "OpenForm action was canceled" when the box is blank. How would I
modify the query to pull all results ([RandomMarker]="Y" or Null) when the
box is not checked?
SELECT tbl_tt_trans.TransNo, tbl_tt_trans.Fac, tbl_tt_trans.CODE,
tbl_tt_trans.RandomMarker, tbl_tt_trans.UseDT, tbl_tt_trans.TransNo
FROM tbl_tt_trans
WHERE (((tbl_tt_trans.CODE)=[Forms]![frm_switchboard]![swCode]) AND
((tbl_tt_trans.RandomMarker)=[Forms]![frm_switchboard]![chk_rndm]) AND
((tbl_tt_trans.PtType) Not Like "O"))
ORDER BY tbl_tt_trans.UseDT;
thanks for the help