Combo box to also select all options

Voodoo223

Registered User.
Local time
Today, 13:48
Joined
Jun 16, 2005
Messages
16
I am having an issue with a combo box on a form with the following query. It works exactly as it should, but unfortunatly, I need a little more.

cboASC is off a table, cboQCode is from values, If I don't fill 1 of the combo boxes I get a blank record (just fields).

What I need is an option to choose all Primary Locators and/or all Qcodes for a general report instead of a local report.

SELECT CallsEntered.[Work Order Nbr], CallsEntered.[Date Entered], CallsEntered.[Time Entered], CallsEntered.[Primary Locator Code] AS [ASC], CallsEntered.Headend, CallsEntered.Node, CallsEntered.[Grid Id], CallsEntered.[Q Code], CallsEntered.[Problem Code 01], CallsEntered.[Primary Finding Code], CallsEntered.[Primary Solution Code], CallsEntered.[Cancel Code], CallsEntered.[Scheduled Date], CallsEntered.[Wo Status], CallsEntered.[Date CheckIn], CallsEntered.[Assigned Installer], Calendar.Week, Calendar.Year
FROM Calendar INNER JOIN CallsEntered ON Calendar.Date = CallsEntered.[Date Entered]
WHERE (((CallsEntered.[Date Entered]) Between [Forms]![frmServiceCalls]![txtStartDate] And [Forms]![frmServiceCalls]![txtEndDate]) AND ((CallsEntered.[Primary Locator Code])=[Forms]![frmServiceCalls]![cboASC]) AND ((CallsEntered.[Q Code])=[Forms]![frmServiceCalls]![cboQCode]));

Your time and help is appreciated.
 
Try this criteria:-

WHERE ((([CallsEntered].[Date Entered]>=[Forms]![frmServiceCalls]![txtStartDate] Or [Forms]![frmServiceCalls]![txtStartDate] Is Null)=True) AND (([CallsEntered].[Date Entered]<=[Forms]![frmServiceCalls]![txtEndDate] Or [Forms]![frmServiceCalls]![txtEndDate] Is Null)=True) AND (([CallsEntered].[Primary Locator Code]=[Forms]![frmServiceCalls]![cboASC] Or [Forms]![frmServiceCalls]![cboASC] Is Null)=True) AND (([CallsEntered].[Q Code]=[Forms]![frmServiceCalls]![cboQCode] Or [Forms]![frmServiceCalls]![cboQCode] Is Null)=True));


which is derived from Jon K's Basic Criteria Format in the Sample Databases forum:-
Query By Form - using Text Boxes and Combo Boxes in criteria
http://www.access-programmers.co.uk/forums/showthread.php?t=103312

^
 
That is exactly what I am looking for. Thank you very much.
I will look a little harder next time.
 

Users who are viewing this thread

Back
Top Bottom