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

Report Dates

Status
Not open for further replies.

dodge20

MIS
Jan 15, 2003
1,048
US
I have several list boxes that are based on queries that each require the user to enter a date. So when I run the form, it asks for the dates several times. Is it possible to make it so you enter the date once, and it will use that date for each list box??

Here are my queries if this helps any.

SELECT salespeople.SalesPeopleName, sum(ordertotal) As OrderTotal
FROM orderentry, salespeople
WHERE (((orderentry.SalesPersonnumber)=[salespeoplenumber])) And orderdate Between [Enter Begin Date] And [Enter End Date]
GROUP BY salespeople.SalesPeopleName;

SELECT salespeople.SalesPeopleName, Sum(IIf(billingfrequency=0,Amount)) AS Once, Sum(IIf(billingfrequency=1,Amount*7)) AS Daily, Sum(IIf(billingfrequency=2,Amount)) AS Weekly, Sum(IIf(billingfrequency=3,Amount/4)) AS Monthly
FROM lineorder, salespeople
WHERE (((lineorder.SalesPerson)=[salespeoplenumber])) And StartDate Between [Enter Begin Date] And [Enter End Date]
GROUP BY salespeople.SalesPeopleName;



Dodge20
 
One way to handle this is to have the user enter the dates on a small form. Then set the criteria lines of your queries to
Between Forms!FormName![BeginDateField] And Forms!FormName![EndDateField]

Then you will not receive any prompt.

That's about the only way I know to do what you want.

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top