From: Leif Thorsen on
I have a query based om a table with a bunch of posts sorted by the field
"Date". The query is based on the criteria "Between Date1 and Date2" in the
field "Date". I want to show Date1 and Date2 in the header in a report based
on the question above even if there are no posts with just these dates in the
field "Dare".
How to do ??
--
Thanks in advance for Your help
From: John W. Vinson on
On Thu, 4 Mar 2010 08:03:02 -0800, Leif Thorsen
<LeifThorsen(a)discussions.microsoft.com> wrote:

>I have a query based om a table with a bunch of posts sorted by the field
>"Date". The query is based on the criteria "Between Date1 and Date2" in the
>field "Date". I want to show Date1 and Date2 in the header in a report based
>on the question above even if there are no posts with just these dates in the
>field "Dare".
>How to do ??

One thing I'd suggest is changing the name of the field Date. It's a reserved
word (for the builtin Date() function) and can and will cause trouble.

If you are using a parameter query with criteria like

Between [Date1] AND [Date2]

then you can use a textbox on the report with a control source

=[Date1]

You'll be better off using a form to provide the criteria: say the form is
named frmCrit, with textboxes txtStartdate and txtEnddate. You can then use

>= [Forms]![frmCrit]![txtStartDate] AND < DateAdd("d", 1, [Forms]![frmCrit]![txtEndDate])

to catch date/time values with a time component on the last day; you can then
use a textbox with a control source

=[Forms]![frmCrit]![txtStartDate]

and the same for the end date.
--

John W. Vinson [MVP]
From: Leif Thorsen on

--
Thanks in advance for Your help


"John W. Vinson" wrote:

> On Thu, 4 Mar 2010 08:03:02 -0800, Leif Thorsen
> <LeifThorsen(a)discussions.microsoft.com> wrote:
>
> >I have a query based om a table with a bunch of posts sorted by the field
> >"Date". The query is based on the criteria "Between Date1 and Date2" in the
> >field "Date". I want to show Date1 and Date2 in the header in a report based
> >on the question above even if there are no posts with just these dates in the
> >field "Dare".
> >How to do ??
>
> One thing I'd suggest is changing the name of the field Date. It's a reserved
> word (for the builtin Date() function) and can and will cause trouble.
>
> If you are using a parameter query with criteria like
>
> Between [Date1] AND [Date2]
>
> then you can use a textbox on the report with a control source
>
> =[Date1]
>
> You'll be better off using a form to provide the criteria: say the form is
> named frmCrit, with textboxes txtStartdate and txtEnddate. You can then use
>
> >= [Forms]![frmCrit]![txtStartDate] AND < DateAdd("d", 1, [Forms]![frmCrit]![txtEndDate])
>
> to catch date/time values with a time component on the last day; you can then
> use a textbox with a control source
>
> =[Forms]![frmCrit]![txtStartDate]
>
> and the same for the end date.
> --
>
> John W. Vinson [MVP]

> .Thank You for Your solution but if I donĀ“t want to use a separate form for this ??
The reason for this is that the command for the report is given from a
start-upform and I want to have the report directly from this start-upform.
Do You have a solution for this ???

>
From: John W. Vinson on
On Sun, 7 Mar 2010 11:50:01 -0800, Leif Thorsen
<LeifThorsen(a)discussions.microsoft.com> wrote:

>The reason for this is that the command for the report is given from a
>start-upform and I want to have the report directly from this start-upform.
>Do You have a solution for this ???

A couple; one would be to put textboxes on the startup form and reference
them. If you don't want the textboxes cluttering the form, an alternative
would be to have a small unbound form. You can put code in the Report's Open
event to open the form in Dialog view; the "open" event fires before the
recordsource of the report is populated, so the form will open and allow the
user to enter the dates. Put a button on the form to set the form's Visible
property to No; this will let the report's code resume, opening the report.

Put code in the Report's Close event to close the form.
--

John W. Vinson [MVP]
From: De Jager on

"Leif Thorsen" <LeifThorsen(a)discussions.microsoft.com> wrote in message
news:D496B874-A6B9-4845-AE12-9EF92033CF85(a)microsoft.com...
>I have a query based om a table with a bunch of posts sorted by the field
> "Date". The query is based on the criteria "Between Date1 and Date2" in
> the
> field "Date". I want to show Date1 and Date2 in the header in a report
> based
> on the question above even if there are no posts with just these dates in
> the
> field "Dare".
> How to do ??
> --
> Thanks in advance for Your help

 |  Next  |  Last
Pages: 1 2
Prev: feier
Next: Spell checking in Access