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, 3 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
-
Microsoft: Troubleshoot problems updating Windows
by
Alex5723
3 hours, 30 minutes ago -
Woman Files for Divorce After ChatGPT “Reads” Husband’s Coffee Cup
by
Alex5723
3 hours, 38 minutes ago -
Moving fwd, Win 11 Pro,, which is best? Lenovo refurb
by
Deo
2 hours, 26 minutes ago -
DBOS Advanced Network Analysis
by
Kathy Stevens
13 hours, 28 minutes ago -
Microsoft Edge Launching Automatically?
by
healeyinpa
3 hours, 53 minutes ago -
Google Chrome to block admin-level browser launches for better security
by
Alex5723
16 hours, 8 minutes ago -
iPhone SE2 Stolen Device Protection
by
Rick Corbett
8 hours, 24 minutes ago -
Some advice for managing my wireless internet gateway
by
LHiggins
4 hours, 5 minutes ago -
NO POWER IN KEYBOARD OR MOUSE
by
HE48AEEXX77WEN4Edbtm
10 hours, 21 minutes ago -
A CVE-MITRE-CISA-CNA Extravaganza
by
Nibbled To Death By Ducks
1 day, 1 hour ago -
Sometimes I wonder about these bots
by
Susan Bradley
21 hours, 55 minutes ago -
Does windows update component store “self heal”?
by
Mike Cross
11 hours, 58 minutes ago -
Windows 11 Insider Preview build 27858 released to Canary
by
joep517
1 day, 15 hours ago -
Pwn2Own Berlin 2025: Day One Results
by
Alex5723
1 day, 15 hours ago -
Windows 10 might repeatedly display the BitLocker recovery screen at startup
by
Susan Bradley
3 hours, 13 minutes ago -
Windows 11 Insider Preview Build 22631.5409 (23H2) released to Release Preview
by
joep517
1 day, 18 hours ago -
Windows 10 Build 19045.5912 (22H2) to Release Preview Channel
by
joep517
1 day, 18 hours ago -
Kevin Beaumont on Microsoft Recall
by
Susan Bradley
1 day, 6 hours ago -
The Surface Laptop Studio 2 is no longer being manufactured
by
Alex5723
2 days, 2 hours ago -
0Patch, where to begin
by
cassel23
1 day, 20 hours ago -
CFPB Quietly Kills Rule to Shield Americans From Data Brokers
by
Alex5723
2 days, 16 hours ago -
89 million Steam account details just got leaked,
by
Alex5723
2 days, 3 hours ago -
KB5058405: Linux – Windows dual boot SBAT bug, resolved with May 2025 update
by
Alex5723
3 days ago -
A Validation (were one needed) of Prudent Patching
by
Nibbled To Death By Ducks
2 days, 15 hours ago -
Master Patch Listing for May 13, 2025
by
Susan Bradley
2 days, 2 hours ago -
Installer program can’t read my registry
by
Peobody
45 minutes ago -
How to keep Outlook (new) in off position for Windows 11
by
EspressoWillie
2 days, 13 hours ago -
Intel : CVE-2024-45332, CVE-2024-43420, CVE-2025-20623
by
Alex5723
2 days, 20 hours ago -
False error message from eMClient
by
WSSebastian42
3 days, 11 hours ago -
Awoke to a rebooted Mac (crashed?)
by
rebop2020
3 days, 20 hours 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.