A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Question about date ranges on a report...



 
 
Thread Tools Display Modes
  #1  
Old May 8th, 2007, 06:44 PM posted to microsoft.public.access.reports
imnewtoaccess
external usenet poster
 
Posts: 16
Default Question about date ranges on a report...

I'm following instructions from a thread I found here, which I've posted
below. I'm having trouble with one step:

As criteria in the query date field write:
Between forms!ParamForm!StartDate and forms!ParamForm!EndDate


Where is the query date field??


Create an unbound form.
Add 2 unbound text controls.
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 the query date field write:
Between forms!ParamForm!StartDate and forms!ParamForm!EndDate

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

Code the report's Close event:
DoCmd.Close acForm, "ParamForm"

When ready to run the report, open the report.
The form will open and wait for the entry of the starting and ending
dates.
Click the command button and the report will run.
When the report closes, it will close the form.


  #2  
Old May 8th, 2007, 07:52 PM posted to microsoft.public.access.reports
fredg
external usenet poster
 
Posts: 4,386
Default Question about date ranges on a report...

On Tue, 8 May 2007 10:44:01 -0700, imnewtoaccess wrote:

I'm following instructions from a thread I found here, which I've posted
below. I'm having trouble with one step:

As criteria in the query date field write:
Between forms!ParamForm!StartDate and forms!ParamForm!EndDate


Where is the query date field??

Create an unbound form.
Add 2 unbound text controls.
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 the query date field write:
Between forms!ParamForm!StartDate and forms!ParamForm!EndDate

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

Code the report's Close event:
DoCmd.Close acForm, "ParamForm"

When ready to run the report, open the report.
The form will open and wait for the entry of the starting and ending
dates.
Click the command button and the report will run.
When the report closes, it will close the form.


In the query that is used as the record source for the report.

Open the report in Design View.
Display the report's property sheet. Click on the Data tab.
The first property is the RecordSource property. If the RecordSource
is a query (as it should be), click on the little button with 3 dots
that appears on that line.
The Query grid will open.
As criteria for the Date field column (I have no way of knowing what
the name of your actual date field is), write:

Between forms!ParamForm!StartDate and forms!ParamForm!EndDate

Save the changes.

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
  #3  
Old May 8th, 2007, 08:22 PM posted to microsoft.public.access.reports
imnewtoaccess
external usenet poster
 
Posts: 16
Default Question about date ranges on a report...

thank you so much for your response!!

however, i did that and when i went to close the recordsource, it asked if i
wanted to save the new query. i did - not sure if that has anything to do
with the error i'm getting.

the error is that when i put in the date ranges, it tells me that there's no
data for the report and it cancels the report. what did i do wrong?

"fredg" wrote:

On Tue, 8 May 2007 10:44:01 -0700, imnewtoaccess wrote:

I'm following instructions from a thread I found here, which I've posted
below. I'm having trouble with one step:

As criteria in the query date field write:
Between forms!ParamForm!StartDate and forms!ParamForm!EndDate


Where is the query date field??

Create an unbound form.
Add 2 unbound text controls.
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 the query date field write:
Between forms!ParamForm!StartDate and forms!ParamForm!EndDate

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

Code the report's Close event:
DoCmd.Close acForm, "ParamForm"

When ready to run the report, open the report.
The form will open and wait for the entry of the starting and ending
dates.
Click the command button and the report will run.
When the report closes, it will close the form.


In the query that is used as the record source for the report.

Open the report in Design View.
Display the report's property sheet. Click on the Data tab.
The first property is the RecordSource property. If the RecordSource
is a query (as it should be), click on the little button with 3 dots
that appears on that line.
The Query grid will open.
As criteria for the Date field column (I have no way of knowing what
the name of your actual date field is), write:

Between forms!ParamForm!StartDate and forms!ParamForm!EndDate

Save the changes.

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

  #4  
Old May 8th, 2007, 08:59 PM posted to microsoft.public.access.reports
imnewtoaccess
external usenet poster
 
Posts: 16
Default Question about date ranges on a report...

It's also telling me:

The specified field “days and times” could refer to more than one table
listed in the FROM clause of your SQL statement.

Not sure what that means or how to fix it...

"fredg" wrote:

On Tue, 8 May 2007 10:44:01 -0700, imnewtoaccess wrote:

I'm following instructions from a thread I found here, which I've posted
below. I'm having trouble with one step:

As criteria in the query date field write:
Between forms!ParamForm!StartDate and forms!ParamForm!EndDate


Where is the query date field??

Create an unbound form.
Add 2 unbound text controls.
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 the query date field write:
Between forms!ParamForm!StartDate and forms!ParamForm!EndDate

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

Code the report's Close event:
DoCmd.Close acForm, "ParamForm"

When ready to run the report, open the report.
The form will open and wait for the entry of the starting and ending
dates.
Click the command button and the report will run.
When the report closes, it will close the form.


In the query that is used as the record source for the report.

Open the report in Design View.
Display the report's property sheet. Click on the Data tab.
The first property is the RecordSource property. If the RecordSource
is a query (as it should be), click on the little button with 3 dots
that appears on that line.
The Query grid will open.
As criteria for the Date field column (I have no way of knowing what
the name of your actual date field is), write:

Between forms!ParamForm!StartDate and forms!ParamForm!EndDate

Save the changes.

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

  #5  
Old May 8th, 2007, 10:17 PM posted to microsoft.public.access.reports
fredg
external usenet poster
 
Posts: 4,386
Default Question about date ranges on a report...

On Tue, 8 May 2007 12:22:00 -0700, imnewtoaccess wrote:

thank you so much for your response!!

however, i did that and when i went to close the recordsource, it asked if i
wanted to save the new query. i did - not sure if that has anything to do
with the error i'm getting.

the error is that when i put in the date ranges, it tells me that there's no
data for the report and it cancels the report. what did i do wrong?

"fredg" wrote:

On Tue, 8 May 2007 10:44:01 -0700, imnewtoaccess wrote:

I'm following instructions from a thread I found here, which I've posted
below. I'm having trouble with one step:

As criteria in the query date field write:
Between forms!ParamForm!StartDate and forms!ParamForm!EndDate

Where is the query date field??

Create an unbound form.
Add 2 unbound text controls.
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 the query date field write:
Between forms!ParamForm!StartDate and forms!ParamForm!EndDate

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

Code the report's Close event:
DoCmd.Close acForm, "ParamForm"

When ready to run the report, open the report.
The form will open and wait for the entry of the starting and ending
dates.
Click the command button and the report will run.
When the report closes, it will close the form.


In the query that is used as the record source for the report.

Open the report in Design View.
Display the report's property sheet. Click on the Data tab.
The first property is the RecordSource property. If the RecordSource
is a query (as it should be), click on the little button with 3 dots
that appears on that line.
The Query grid will open.
As criteria for the Date field column (I have no way of knowing what
the name of your actual date field is), write:

Between forms!ParamForm!StartDate and forms!ParamForm!EndDate

Save the changes.

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail


You'll need to copy the query SQL and paste it into a reply message.
In addition, indicate what dates you have entered in the form
controls, as well as an example of what you know is a valid date that
should have been returned.

Note: If the date field contains a time value, a parameter entry of
5/8/2007 to 5/9/2007 will not return entries on 5/9/2007 as 5/9/2007
12:15 PM is later than 5/9/2007 midnight. In this instance you must
add 1 day to the range, i.e. 5/8/2007 to 5/10/2007.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
  #6  
Old May 8th, 2007, 10:18 PM posted to microsoft.public.access.reports
fredg
external usenet poster
 
Posts: 4,386
Default Question about date ranges on a report...

On Tue, 8 May 2007 12:59:02 -0700, imnewtoaccess wrote:

It's also telling me:

The specified field days and times could refer to more than one table
listed in the FROM clause of your SQL statement.

Not sure what that means or how to fix it...

"fredg" wrote:

On Tue, 8 May 2007 10:44:01 -0700, imnewtoaccess wrote:

I'm following instructions from a thread I found here, which I've posted
below. I'm having trouble with one step:

As criteria in the query date field write:
Between forms!ParamForm!StartDate and forms!ParamForm!EndDate

Where is the query date field??

Create an unbound form.
Add 2 unbound text controls.
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 the query date field write:
Between forms!ParamForm!StartDate and forms!ParamForm!EndDate

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

Code the report's Close event:
DoCmd.Close acForm, "ParamForm"

When ready to run the report, open the report.
The form will open and wait for the entry of the starting and ending
dates.
Click the command button and the report will run.
When the report closes, it will close the form.


In the query that is used as the record source for the report.

Open the report in Design View.
Display the report's property sheet. Click on the Data tab.
The first property is the RecordSource property. If the RecordSource
is a query (as it should be), click on the little button with 3 dots
that appears on that line.
The Query grid will open.
As criteria for the Date field column (I have no way of knowing what
the name of your actual date field is), write:

Between forms!ParamForm!StartDate and forms!ParamForm!EndDate

Save the changes.

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

Evidently you have a field named [Days and Times] which is available
in more than one table in the query. You'll need to set the table name
to whichever table's [Days and Times] field you wish to use in the
query.
In the query design view grid, it's the second row drop-down in the
[Days and Times] column.

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:13 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright 2004-2024 OfficeFrustration.
The comments are property of their posters.