Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query form with multiple parameters

Status
Not open for further replies.

robwheels

Technical User
Jul 25, 2001
34
US
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!
 




Hi,

This statement could be a problem...
Code:
(((RTS.CorrDate) Between [Forms]![Query Form]![StartDate] And [Forms]![Query Form]![EndDate]))
as the [StartDate] and [EndDate] are STRINGS and must be converted to real dates, which are NUMBERS...
(((RTS.CorrDate) Between #[Forms]![Query Form]![StartDate]# And #[Forms]![Query Form]![EndDate]#))
[/code]


Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Skip,
Thanks!

How would this affect my check box criteria?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top