Date Selection

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a query with a date range hard coded for report proceedures. Well part
of the problem when having users manually selecting dates, it has to be done
multiple times. Is there a way that you only have to enter the date once?

Thanks,
Lee
 
Why should users have to manually select dates multiple times? Are you using
controls on forms for your users to enter dates?
 
Dear Lee:

Possibly this is being started by clicking something on a form. You could
put controls on that form in which the users can select the date range, and
reference those from the query.

Tom Ellison
 
How do you put the controls on a form?


Tom Ellison said:
Dear Lee:

Possibly this is being started by clicking something on a form. You could
put controls on that form in which the users can select the date range, and
reference those from the query.

Tom Ellison
 
Here is my query...

SELECT
[ID Card].Date,
[ID Card].Retirees,
[ID Card].Transitional,
[ID Card].[Disabled Vets 100%],
[ID Card].Dependents,
[ID Card].[Other Trrans / DEERS],
[ID Card].[All Cards],
[ID Card].[Active Duty],
[ID Card].USAR,
[ID Card].ARNG,
[ID Card].[Civil Service],
[ID Card].[DOD Contractor],
[ID Card].[Non App Funds],
[ID Card].Favorable,
[ID Card].Unfavorable,
[All Cards]+[Active Duty]+[USAR]+[ARNG]+[Civil Service]+[DOD
Contractor]+[Non App Funds] AS Total
FROM [ID Card];
 
Dear Lee:

In the usual way. I'm not sure what you're asking. Just make sure the
controls have names that are unique, not the same as, say, the name of a
column in the form's RecordSource. Using a prefix or suffix which is the
control type's abbreviation is useful and effective.

Tom Ellison
 
I have a query with a date range hard coded for report proceedures. Well part
of the problem when having users manually selecting dates, it has to be done
multiple times. Is there a way that you only have to enter the date once?

Thanks,
Lee

Your running multiple reports and want the same dates on all of them.
Is there alway one report that is run first and one report that is run
last? If so ...
Create an unbound form.

Add 2 unbound text controls to the form.
Set their format to a valid date format.
Name them "StartDate" and "EndDate"

Add a Command Button to the form.
Code the button's click event:

Me.Visible = False

Name this form 'ParamForm'.

As criteria in each query's date field write:
Between forms!Paramform!StartDate and forms!ParamForm!EndDate

Next, code the first report's Open event:
DoCmd.OpenForm "ParamForm", , , , , acDialog

Code the close event of the last report to run:
DoCmd.Close acForm, "ParamForm"

When ready to run the report(s), open the report.
The form will open and wait for the entry of the starting and ending
dates wanted.
Click the command button and the report will run.

As long as this form is open, the dates will be accessible to any
query.

When that last report closes, it will close the form.

If the reports are run in a random order, open change the Click event
on the form from Me.Visible = False to:
DoCmd.Close acForm, Me.Name

Do NOT code the Open or Close event (as shown above) of any of the
reports.

Simply open this form, enter the dates, DO NOT CLICK the command
button. Click the form's Minimize button.
The form will be open but hidden, until you manually close it by
re-showing it and clicking it's command button.
 
Check fredg's response elsewhere in this thread to find out about using
controls on forms.
--
Duane Hookom
MS Access MVP

lmossolle said:
Here is my query...

SELECT
[ID Card].Date,
[ID Card].Retirees,
[ID Card].Transitional,
[ID Card].[Disabled Vets 100%],
[ID Card].Dependents,
[ID Card].[Other Trrans / DEERS],
[ID Card].[All Cards],
[ID Card].[Active Duty],
[ID Card].USAR,
[ID Card].ARNG,
[ID Card].[Civil Service],
[ID Card].[DOD Contractor],
[ID Card].[Non App Funds],
[ID Card].Favorable,
[ID Card].Unfavorable,
[All Cards]+[Active Duty]+[USAR]+[ARNG]+[Civil Service]+[DOD
Contractor]+[Non App Funds] AS Total
FROM [ID Card];


Duane Hookom said:
Why should users have to manually select dates multiple times? Are you
using
controls on forms for your users to enter dates?
 
Fred,

I was curious if you would be able to assist with this. I use a graph and
would like to do 2 things if at all possible.
1 - For the year 2006 I would like to have a bar chart!
2 - For the year of 2005 I would like to have a line chart combined with the
above for referance.

Is this possible?

Here is my coding for the query.

SELECT
[DA Photo].Date,
[DA Photo].Scheduled,
[DA Photo].Cancelled,
[DA Photo].[No Shows],
[DA Photo].Arrived,
[DA Photo].[Standbys Seen],
[DA Photo].[Promotion Boards],
[DA Photo].[Special Packets],
[DA Photo].[Command Required],
[DA Photo].[Field Photos],
[DA Photo].[4 x 6 Prints],
[DA Photo].[8 x 10 Prints],
[DA Photo].[Digital CD's],
[DA Photo].[Images to DAPMIS],
[DA Photo].[Active Army],
[DA Photo].[USAR / NG],
[DA Photo].[General Officers],
[DA Photo].[Other Services],
[DA Photo].Favorable,
[DA Photo].Unfavorable
FROM [DA Photo]
WHERE ((([DA Photo].Date) Between #1/1/2005# And #3/31/2006#));
 
Fred,

I was curious if you would be able to assist with this. I use a graph and
would like to do 2 things if at all possible.
1 - For the year 2006 I would like to have a bar chart!
2 - For the year of 2005 I would like to have a line chart combined with the
above for referance.

Is this possible?

Here is my coding for the query.

SELECT
[DA Photo].Date,
[DA Photo].Scheduled,
[DA Photo].Cancelled,
[DA Photo].[No Shows],
[DA Photo].Arrived,
[DA Photo].[Standbys Seen],
[DA Photo].[Promotion Boards],
[DA Photo].[Special Packets],
[DA Photo].[Command Required],
[DA Photo].[Field Photos],
[DA Photo].[4 x 6 Prints],
[DA Photo].[8 x 10 Prints],
[DA Photo].[Digital CD's],
[DA Photo].[Images to DAPMIS],
[DA Photo].[Active Army],
[DA Photo].[USAR / NG],
[DA Photo].[General Officers],
[DA Photo].[Other Services],
[DA Photo].Favorable,
[DA Photo].Unfavorable
FROM [DA Photo]
WHERE ((([DA Photo].Date) Between #1/1/2005# And #3/31/2006#));
*** snipped ****il

Please do not piggy-back posts with different subjects.
Start a new thread so that anyone else who might have an interest in
this can see it.
 
Back
Top