I have reports based on parameter queries which ask for two dates and then finds those records Between [First Date] and [Second Date]. How can I display these two dates on the reports?! Thanks, Andy.
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Displaying two parameters (97)
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Displaying two parameters (97)
- This topic has 14 replies, 5 voices, and was last updated 20 years, 2 months ago.
AuthorTopicWSandrewgibsonsw
AskWoody LoungerFebruary 15, 2005 at 10:34 am #415920Viewing 1 reply threadAuthorReplies-
WSjaf90
AskWoody Lounger -
WSHansV
AskWoody LoungerFebruary 15, 2005 at 10:49 am #928678You can create a text box with controil source =[First Date] and another one with control source =[Second Date]. You can set the Format properties of the text boxes to the appropriate date format.
Alternatively, you can use one text box; you must take care of the formatting in the control source:
=”Sales between ” & Format([First Date], “d-mmm-yyyy”) & ” and ” & Format([Second Date], “d-mmm-yyyy”)
Take care to use the parameters exactly as in the query. You can use a different date format, of course.
-
WSandrewgibsonsw
AskWoody Lounger -
WSHansV
AskWoody Lounger -
WSandrewgibsonsw
AskWoody LoungerFebruary 15, 2005 at 12:05 pm #928692Oops! You’re right! I’ve tried your text-box expression but get #Error appearing on the report. My parameter query has the criteria ‘Between [Enter first date] And [Enter last date]’ for a date field and I’ve then used the precise expressions [Enter first date] and [Enter last date] on my report?
Can you think why I’m still getting #Error?? Thanks, Andy. -
WSHansV
AskWoody LoungerFebruary 15, 2005 at 12:16 pm #928694If you are absolutely sure that you copied the expression correctly and substituted the exact parameter names, you can try declaring the parameters in the query:
– Open the query in design view.
– Select Query | Parameters…
– Type [Enter first date] and set the data type to Date/Time.
– In the next line, type [Enter last date] ans set the data type to Date/Time.
– Click OK.
– Save the query. -
WSandrewgibsonsw
AskWoody Lounger -
WSHansV
AskWoody LoungerFebruary 15, 2005 at 12:39 pm #928705You don’t need to use the Format function. If you omit Format, the dates will be displayed as they are entered by the user if you haven’t declared the parameters, or in short date format if you have declared the parameters as Date/Time.
Sometimes it helps to delete the text box and recreate it from scratch.
-
WSandrewgibsonsw
AskWoody Lounger -
WSHansV
AskWoody Lounger -
WSandrewgibsonsw
AskWoody Lounger -
WSroberta
AskWoody Lounger -
WSRudi
AskWoody Lounger -
WSHansV
AskWoody LoungerFebruary 15, 2005 at 2:12 pm #928740A report has an On No Data event. You can use this to cancel opening the report if there are no data to be displayed:
Private Sub Report_NoData(Cancel As Integer)
‘ Cancel report
Cancel = True
‘ Optional: show message
MsgBox “There are no data for this report.”, vbInformation
End SubIf you open the report using DoCmd.OpenReport in VBA, cancelling it will cause error # 2501. You can use error handling to avoid seeing the accompanying error message. For example, in the On Click event of a command button on a form:
Private Sub cmdReport_Click()
On Error GoTo ErrHandler
DoCmd.OpenReport “rptMyReport”, acViewPreview
Exit SubErrHandler:
‘ No message if error = 2501
If Not (Err = 2501) Then
MsgBox Err.Description, vbExclamation
End If
End Sub
-
-
-
-
Viewing 1 reply thread -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Uninstalr Updates
by
jv16
2 hours, 16 minutes ago -
Apple zero days for April
by
Susan Bradley
5 hours, 2 minutes ago -
CVE program gets last-minute funding from CISA – and maybe a new home
by
Nibbled To Death By Ducks
3 hours, 4 minutes ago -
Whistleblower describes DOGE IT dept rumpus at America’s labor watchdog
by
Nibbled To Death By Ducks
14 hours, 53 minutes ago -
Seeing BSOD’s on 24H2?
by
Susan Bradley
1 hour, 12 minutes ago -
TUT For Private Llama LLM, Local Installation and Isolated from the Internet.
by
bbearren
5 hours, 17 minutes ago -
Upgrade from Windows 10 to 11
by
Holdsworth8
23 hours, 33 minutes ago -
Microsoft : AI-powered deception: Emerging fraud threats and countermeasures
by
Alex5723
1 day, 2 hours ago -
0patch
by
WSjcgc50
3 hours, 22 minutes ago -
Devices might encounter blue screen exception with the recent Windows updates
by
Susan Bradley
19 hours, 45 minutes ago -
Windows 11 Insider Preview Build 22631.5261 (23H2) released to Release Preview
by
joep517
1 day, 5 hours ago -
Problem opening image attachments
by
RobertG
1 day, 6 hours ago -
advice for setting up a new windows computer
by
routtco1001
1 day, 21 hours ago -
It’s Identity Theft Day!
by
Susan Bradley
1 day, 1 hour ago -
Android 15 require minimum 32GB of storage
by
Alex5723
2 days, 2 hours ago -
Mac Mini 2018, iPhone 6s 2015 Are Now Vintage
by
Alex5723
2 days, 2 hours ago -
Hertz says hackers stole customer credit card and driver’s license data
by
Alex5723
2 days, 3 hours ago -
Firefox became sluggish
by
Rick Corbett
2 days ago -
Windows 10 Build 19045.5794 (22H2) to Release Preview Channel
by
joep517
2 days, 7 hours ago -
Windows 11 Insider Preview Build 22635.5235 (23H2) released to BETA
by
joep517
2 days, 7 hours ago -
A Funny Thing Happened on the Way to the Forum
by
bbearren
1 day, 4 hours ago -
Download speeds only 0.3Mbps after 24H2 upgrade on WiFi and Ethernet
by
John
1 hour, 49 minutes ago -
T-Mobile 5G Wireless Internet
by
WSmmi16
1 day, 5 hours ago -
Clock missing above calendar in Windows 10
by
WSCape Sand
1 day, 6 hours ago -
Formula to Calculate Q1, Q2, Q3, or Q4 of the Year?
by
WSJon5
2 days, 22 hours ago -
The time has come for AI-generated art
by
Catherine Barrett
2 days, 2 hours ago -
Hackers are using two-factor authentication to infect you
by
B. Livingston
2 days, 12 hours ago -
23 and you
by
Max Stul Oppenheimer
2 days, 19 hours ago -
April’s deluge of patches
by
Susan Bradley
23 hours, 16 minutes ago -
Windows 11 Windows Updater question
by
Tex265
13 hours, 11 minutes ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.