Query question with multipal parameters

rhett7660

Still Learning....
Local time
Today, 10:23
Joined
Aug 25, 2005
Messages
371
Hello..

I have a query that has multipal parameters for that query. I want to be able to set it up so that the person doesn't have to use all the parameters.. IE then can use just the dates, or just the test type etc...

Here is the sql that I am currently using:

Code:
SELECT tblApplicant.ApplicantID, tblApplicant.ApplicantLName, tblApplicant.ApplicantFName, tblApplicant.LastFour, tblApplicant.TestDate, tblApplicant.JacketExpireDate, tblApplicant.Comment, tblApplicant.HomePhone, tblApplicant.CellPhone, tblApplicant.WorkPhone, tblApplicant.ContinueProcessDate, [ApplicantLName] & ", " & [ApplicantFName] AS Name, tblYsNo.YesNoType, tblLuTestType.Type
FROM tblYsNo INNER JOIN ((tblApplicant INNER JOIN tblLuTestType ON tblApplicant.TestType = tblLuTestType.TestType) INNER JOIN tblCaller ON tblApplicant.ApplicantID = tblCaller.ApplicantID) ON tblYsNo.YesNoMain = tblApplicant.Interested
WHERE (((tblApplicant.ApplicantID)=[Forms]![frmMainData]![ApplicantID]) AND ((tblApplicant.JacketExpireDate) Between [Forms]![frmReport]![txtStartInt] And [Forms]![frmReport]![txtEndInt]))
ORDER BY tblApplicant.ApplicantLName;

Thanks
 
I have a query that has multipal parameters for that query. I want to be able to set it up so that the person doesn't have to use all the parameters.. IE then can use just the dates, or just the test type etc...
Code:
SELECT tblApplicant.ApplicantID, tblApplicant.ApplicantLName, tblApplicant.ApplicantFName, 
tblApplicant.LastFour, tblApplicant.TestDate, tblApplicant.JacketExpireDate, 
tblApplicant.Comment, tblApplicant.HomePhone, tblApplicant.CellPhone, 
tblApplicant.WorkPhone, tblApplicant.ContinueProcessDate, 
[ApplicantLName] & ", " & [ApplicantFName] AS Name, 
tblYsNo.YesNoType, tblLuTestType.Type

FROM tblYsNo INNER JOIN ((tblApplicant INNER JOIN tblLuTestType ON 
tblApplicant.TestType = tblLuTestType.TestType) INNER JOIN tblCaller ON 
tblApplicant.ApplicantID = tblCaller.ApplicantID) ON tblYsNo.YesNoMain = tblApplicant.Interested

WHERE (((tblApplicant.ApplicantID)=[Forms]![frmMainData]![ApplicantID]) AND 
((tblApplicant.JacketExpireDate) Between [Forms]![frmReport]![txtStartInt] And [Forms]![frmReport]![txtEndInt]))

ORDER BY tblApplicant.ApplicantLName;
Use....
Code:
WHERE ((tblApplicant.ApplicantID = [Forms]![frmMainData]![ApplicantID] OR 

[Forms]![frmMainData]![ApplicantID] Is Null) AND 

((tblApplicant.JacketExpireDate Between [Forms]![frmReport]![txtStartInt] And 

[Forms]![frmReport]![txtEndInt]) OR ([Forms]![frmReport]![txtStartInt] Is Null AND 

[Forms]![frmReport]![txtEndInt] Is Null)));
 
Last edited:
Rhett, I refreshed the page a couple of times because I wrote the code wrong, it is right now.
 
ajetrumpet

When I imput your code I am getting an error with a yellow triangle with an exclimation mark in it..
 
Last edited:
does it say anything??

Did you use it after I refreshed the page?? Did you see my last message??
 
Just saw your refresh... trying now.. it didn't say anything, it had the code I put in with the triangle and exclimation mark
 

Users who are viewing this thread

Back
Top Bottom