Im not sure why the data base is trying to compare anything to the form_name
field. I havent put it in any of the criteria so im not sure where that one
is coming from.
If the chkedi is check I want the report to return only records where edi is
set to yes. Edi is a yes/no field on the table.
That makes it ambiguous here: if the form checkbox chkEdi is False, do you
want to return records where the table field is False, or do you want to
return all records?
That might be part of the issue if a check box checked/unchecked returns a
different number than a yes/no.
That's not a problem. A checkbox is either -1 if it's checked or 0 if not; the
same values are used for TRUE and FALSE in the table.
IF - and it's a big if! - you want to retrieve all records if chkEdi is False,
and only records where Edi is TRUE if it's checked, try
SELECT bncforms_table.formnumber, bncforms_table.form_name,
bncforms_table.edi, bncforms_table.events, bncforms_table.[Weather Ntc],
bncforms_table.[No Enter]
FROM bncforms_table
WHERE (((bncforms_table.Edi)=[Forms]![FormRpt]![chkEdi]))
OR [Forms]![FormRpt]![chkEdi] = False;
or, more simply but requires some mental contortions to get the Boolean logic,
SELECT bncforms_table.formnumber, bncforms_table.form_name,
bncforms_table.edi, bncforms_table.events, bncforms_table.[Weather Ntc],
bncforms_table.[No Enter]
FROM bncforms_table
WHERE bncforms_table.Edi OR NOT [Forms]![FormRpt]![chkEdi];
--
John W. Vinson JVinson *at* Wysard Of Info *dot* com
--
John W. Vinson [MVP]
.