List Box

G

Guest

My query runs based on Data Data entered on a form:
WHERE (((tblQualityData.IssueCloseDate) Between
[forms]![frmReportsQuality].[txtstart] And
[forms]![frmReportsQuality].[txtend])

When I add:
WHERE (((tblQualityData.GBULocation)=[Forms]![frmReportsQuality]![lstArea])
AND ((tblQualityData.IssueCloseDate) Between
[forms]![frmReportsQuality].[txtstart] And
[forms]![frmReportsQuality].[txtend]

Why can I not add the value of a list box to this query????
 
G

Guest

Test what the listbox is providing to the query by adding
[Forms]![frmReportsQuality]![lstArea]
in the SELECT statement without it being in criteria.
 
G

Guest

I added , [Forms]![frmReportsQuality]![lstArea] AS Expr1 - to my Selection.
I get the same amount of cases returned with or without it.
Then if I select one on the form, it still does not change the amount of
cases returned.






KARL DEWEY said:
Test what the listbox is providing to the query by adding
[Forms]![frmReportsQuality]![lstArea]
in the SELECT statement without it being in criteria.

Dan @BCBS said:
My query runs based on Data Data entered on a form:
WHERE (((tblQualityData.IssueCloseDate) Between
[forms]![frmReportsQuality].[txtstart] And
[forms]![frmReportsQuality].[txtend])

When I add:
WHERE (((tblQualityData.GBULocation)=[Forms]![frmReportsQuality]![lstArea])
AND ((tblQualityData.IssueCloseDate) Between
[forms]![frmReportsQuality].[txtstart] And
[forms]![frmReportsQuality].[txtend]

Why can I not add the value of a list box to this query????
 
G

Guest

I guess I did not make myself clear. I mean for you to compare the results
of the Expr1 field with data from your GBULocation field.

If one is a number and the other text then that is the problem.

Dan @BCBS said:
I added , [Forms]![frmReportsQuality]![lstArea] AS Expr1 - to my Selection.
I get the same amount of cases returned with or without it.
Then if I select one on the form, it still does not change the amount of
cases returned.






KARL DEWEY said:
Test what the listbox is providing to the query by adding
[Forms]![frmReportsQuality]![lstArea]
in the SELECT statement without it being in criteria.

Dan @BCBS said:
My query runs based on Data Data entered on a form:
WHERE (((tblQualityData.IssueCloseDate) Between
[forms]![frmReportsQuality].[txtstart] And
[forms]![frmReportsQuality].[txtend])

When I add:
WHERE (((tblQualityData.GBULocation)=[Forms]![frmReportsQuality]![lstArea])
AND ((tblQualityData.IssueCloseDate) Between
[forms]![frmReportsQuality].[txtstart] And
[forms]![frmReportsQuality].[txtend]

Why can I not add the value of a list box to this query????
 
G

Guest

For example maybe the listbox has Alabama or Arizona and the field has AL or
AZ.

KARL DEWEY said:
I guess I did not make myself clear. I mean for you to compare the results
of the Expr1 field with data from your GBULocation field.

If one is a number and the other text then that is the problem.

Dan @BCBS said:
I added , [Forms]![frmReportsQuality]![lstArea] AS Expr1 - to my Selection.
I get the same amount of cases returned with or without it.
Then if I select one on the form, it still does not change the amount of
cases returned.






KARL DEWEY said:
Test what the listbox is providing to the query by adding
[Forms]![frmReportsQuality]![lstArea]
in the SELECT statement without it being in criteria.

:

My query runs based on Data Data entered on a form:
WHERE (((tblQualityData.IssueCloseDate) Between
[forms]![frmReportsQuality].[txtstart] And
[forms]![frmReportsQuality].[txtend])

When I add:
WHERE (((tblQualityData.GBULocation)=[Forms]![frmReportsQuality]![lstArea])
AND ((tblQualityData.IssueCloseDate) Between
[forms]![frmReportsQuality].[txtstart] And
[forms]![frmReportsQuality].[txtend]

Why can I not add the value of a list box to this query????
 

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

Similar Threads

Query Parameter Syntax 2
Query Parameter Syntax 6
Date Problem 11
UNION QUERY (Sorting) 2
UNION SELECT Problem 2
Parameters for query from form 5
Running a Report From A Crosstab Query 1
Date Filter Problem 2

Top