Query form with Combo Boxes and Check Boxes

R

robwheels

I have been working on a query form to return specific values, but there may
be something incorrect with the joins.

The form has several combo boxes to pull values and several check boxes for
selection.
It seems to work, but if I select:
Combo Box1: apples
Check Box1: Checked

The result is apples and oranges…there is a record with Oranges and ‘Check
Box1’ is checked in the record.

My expected result was no record selected since ‘check box1’ has no value in
the apples record.

This is the query I am using:
SELECT DISTINCT RTS.CorrDate, RTS.CorrSource, RTS.CorrType, RTS.
SubmissionType, RTS.SerSupNo, RTS.ProdName, RTS.TypeCMC, RTS.TypePharmTox,
RTS.TypePK, RTS.TypeLabel, RTS.TypeDDMAC, RTS.TypeRA, RTS.Comments
FROM RTS
WHERE (((RTS.CorrDate) Between [Forms]![Query Form]![StartDate] And [Forms]!
[Query Form]![EndDate])) OR (((RTS.CorrSource)=[Forms]![Query Form]![Source]))
OR (((RTS.CorrType)=[Forms]![Query Form]![Type])) OR (((RTS.SubmissionType)=
[Forms]![Query Form]![SubmissionType])) OR (((RTS.ProdName)=[Forms]![Query
Form]![Type])) OR (((RTS.TypeCMC)=[Forms]![Query Form]![CMC_CK])) OR (((RTS.
TypePharmTox)=[Forms]![Query Form]![PharmTOX_CK])) OR (((RTS.TypePK)=[Forms]!
[Query Form]![PK_CK])) OR (((RTS.TypeLabel)=[Forms]![Query Form]![Label_CK]))
OR (((RTS.TypeDDMAC)=[Forms]![Query Form]![DDMAC_CK])) OR (((RTS.TypeRA)=
[Forms]![Query Form]![RA_CK])) OR ((((([RTS].[CorrDate]) Between [Forms]!
[Query Form]![StartDate] And [Forms]![Query Form]![EndDate]) And (([RTS].
[CorrSource])=[Forms]![Query Form]![Source]) And (([RTS].[CorrType])=[Forms]!
[Query Form]![Type]) And (([RTS].[SubmissionType])=[Forms]![Query Form]!
[SubmissionType]) And (([RTS].[ProdName])=[Forms]![Query Form]![Product]))
<>False));

Thanks for the assistance!
 
M

MGFoster

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

It is best to define the data types of the referenced form controls in
the PARAMETERS clause of the SQL statement. E.g.:

PARAMETERS Forms![Query Form]!EndDate DATE, Forms![Query Form]!DDMAC_CK
BIT, ..... etc. ; <- be sure to end the PARAMETERS clause with the
semi-colon.

SELECT ... etc. ...
FROM ...
WHERE ...

A BIT data type is used for a CheckBox (True/False).
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBSRogP4echKqOuFEgEQLpPgCgol+t7iewxTIU7r1TfotS+h1oolIAoMk2
UDuCw1IDGtpgolW2gA594ezC
=iDfv
-----END PGP SIGNATURE-----
 

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