Text Box in a Report

Moxioron

Active Member
Joined
Mar 17, 2008
Messages
436
Office Version
  1. 2019
Hello all.

Here is what I am trying to do.

I have a report that the users run monthly and they are prompted to enter a start date and an end date using Between [Start Date] And [End Date] in the query for [PostingDate].

In the report, at the top, I have a text box with Date Range, which the operator then can enter the date range they already entered so it reflects on the report.

Question, I put =[PostingDate] in the text box thinking that it would reflect the Start Date and End Date the user entered. However, only the start date reflects.

I would like to have it so the operator just has to enter the Start Date and End Date once and then whatever they enter is reflected in the text box on the report.

Thanks for your help.
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Just put [Start Date] and [End Date] in the control source property of the textboxes.
 
Upvote 0
My Start and End Date are 09/01/2011 and 09/30/2011 and when I follow your instructions below it reflects 12/29/1899
 
Upvote 0
I put =[PostingDate] in the text box thinking that it would reflect the Start Date and End Date the user entered. However, only the start date reflects.

Wouldn't PostingDate be a date (one date) rather than a date range (from some date to some date)? I'm not sure I see how you would expect [PostingDate] to just show up in the form "For the Period x To y".

Along the lines of Norie's post, it might work to use the start and end dates from the form:
="From " & [Forms]![Form1]![StartDate] & " To " & [Forms]![Form1]![EndDate]
 
Upvote 0
So it's just one textbox?

This worked for me, using the values you mentioned.

[Start Date] & " to " & [End Date]


xenou

Not sure there is a form.
What the OP said said:
they are prompted to enter a start date and an end date using Between [Start Date] And [End Date] in the query for [PostingDate].
Sounds like inputboxes to me.:)
 
Upvote 0
Just remembered something, did you put = in front of the field names/expression in the control source?

That could cause the date you describe being displayed because Access might calculate 09/01/2011 using / as a division operator not date separator.

09 divided by 1 divided by 2011 is 0.0475.
 
Upvote 0

Forum statistics

Threads
1,224,537
Messages
6,179,405
Members
452,911
Latest member
a_barila

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top