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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Referencing a textbox in a query 1

Status
Not open for further replies.

chiefman

Programmer
Oct 17, 2003
94
0
0
US
I am creating a report with a graph. I have a query that the graph is supposed to use for its Record Source.When I go into datasheet mode and view the query results it asks me for the values of the text boxes and I get the correct data. Nothing unusual there. However when I run the report I get nothing and I think it's because the graph is not being able to get the values of the textboxes. How would I reference that?
(It is a query that pulls from another query.)

Ex.
Original query:

Code:
SELECT Count(PerMonInput.Cancelled_Cases) AS CountOfCancelled_Cases, PerMonInput.Date
FROM PerMonInput
GROUP BY PerMonInput.Date, PerMonInput.Cancelled_Cases
HAVING (((PerMonInput.Cancelled_Cases)="Yes"));

Graph Row Source:
Code:
SELECT Count(*) AS [Count] FROM CancelledCasesDR WHERE (((CancelledCasesDR.Date)>=[text20] And (CancelledCasesDR.Date)<=[label20]));

Just so there's no confusion, label20 is also a textbox. I converted it from a label to a textbox. If anyone has any ideas I would be very grateful. Thanks in advance.
 
Perhaps something this ?
SELECT Count(*) AS [Count]
FROM CancelledCasesDR
WHERE [Date] Between [Forms]![name of open mainform]![text20] And [Forms]![name of open mainform]![label20];

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks. That worked. I had to tweak it some because of the odd way that Access wanted to do it, but your idea helped a lot. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top