-
WSRainyCity4
AskWoody LoungerYep. The particular query had two parameters that needed to be passed through first.
I didn’t bother mentioning it because I tried removing the Name parameter and the query still failed to run. But, much later (until last night), I found out that I had misconfigured the query and broke it. After your explaination about the Dcount, I realized what was actually going on.
Thanks so much for your help.
-
WSRainyCity4
AskWoody LoungerYep. The particular query had two parameters that needed to be passed through first.
I didn’t bother mentioning it because I tried removing the Name parameter and the query still failed to run. But, much later (until last night), I found out that I had misconfigured the query and broke it. After your explaination about the Dcount, I realized what was actually going on.
Thanks so much for your help.
-
WSRainyCity4
AskWoody LoungerJohn,
Thanks for your suggestion. I seriously considered it but then realized that instead of opening report then typing in the name of client, I wondered why couldn’t I just add an extra text box similiar to From Date and To Date and code it the same way the From Date and To Date text boxes were coded. That way, it would be far easier for the staff to simply type in the name and the dates at the main menu and that would also solve the “null report” issue.
So, I did just that. I modified the Main Menu to allow entry of a client name and it works PERFECTLY! I’m so thrilled. Without you and Han’s help, I wouldn’t have came up with an elegant solution to a problem.
Hans, your suggestion to turn off the Error Handling helped me identify the issue
John, your help in figuring out and explaining to me how code worked helped me come up with a solution that works.If you ever are in Seattle, I’ll treat ya to a dinner!
-
WSRainyCity4
AskWoody LoungerJohn,
Thanks for your suggestion. I seriously considered it but then realized that instead of opening report then typing in the name of client, I wondered why couldn’t I just add an extra text box similiar to From Date and To Date and code it the same way the From Date and To Date text boxes were coded. That way, it would be far easier for the staff to simply type in the name and the dates at the main menu and that would also solve the “null report” issue.
So, I did just that. I modified the Main Menu to allow entry of a client name and it works PERFECTLY! I’m so thrilled. Without you and Han’s help, I wouldn’t have came up with an elegant solution to a problem.
Hans, your suggestion to turn off the Error Handling helped me identify the issue
John, your help in figuring out and explaining to me how code worked helped me come up with a solution that works.If you ever are in Seattle, I’ll treat ya to a dinner!
-
WSRainyCity4
AskWoody LoungerHans and John:
Here’s what I discovered when I followed Han’s suggestion:
1) I turned off the Error Handler by commenting it out.
2) When the error message popped up, I clicked on “Debug” and I saw this:If Nz(Me![cboReports]) “” Then
strReportName = Me![cboReports]
strRecordSource = Me![cboReports].Column(2)
If Nz(DCount(“*”, strRecordSource)) > 0 Then **This line was highlighted in yellow and the strRecordSource is showing qryLogNotes which is correct.**
If Me![fraReportMode] = 1 Then
DoCmd.OpenReport ReportName:=strReportName, view:=acPreview
Me.Visible = False
(I didn’t cut and paste the entire If…Then section)Good grief. I figured out why. The line I pointed out checks to make sure that the records isn’t null, hence, it refuses to print report as blank. Unfortunately, that particular query REQUIRES two parameters to be passed through before it will open the report.
1) It first asks me for name of client I want to perform a search on.
2) It asks me for the date range.Since it “checks” the report BEFORE it opens for any records, since I didn’t “enter” the name of client, the main menu finds no records, then it cancels the operation THEN the Name parameter kicks in!
My solution is to add another “field” next to the From Date and To Date and call it “Client Name” or whatever and have the staff enter the name of person and dates at the main form, and it would then enter those parameters before it checks if the records are null. Do you think it will work?
Thanks so much.
-
WSRainyCity4
AskWoody LoungerHans and John:
Here’s what I discovered when I followed Han’s suggestion:
1) I turned off the Error Handler by commenting it out.
2) When the error message popped up, I clicked on “Debug” and I saw this:If Nz(Me![cboReports]) “” Then
strReportName = Me![cboReports]
strRecordSource = Me![cboReports].Column(2)
If Nz(DCount(“*”, strRecordSource)) > 0 Then **This line was highlighted in yellow and the strRecordSource is showing qryLogNotes which is correct.**
If Me![fraReportMode] = 1 Then
DoCmd.OpenReport ReportName:=strReportName, view:=acPreview
Me.Visible = False
(I didn’t cut and paste the entire If…Then section)Good grief. I figured out why. The line I pointed out checks to make sure that the records isn’t null, hence, it refuses to print report as blank. Unfortunately, that particular query REQUIRES two parameters to be passed through before it will open the report.
1) It first asks me for name of client I want to perform a search on.
2) It asks me for the date range.Since it “checks” the report BEFORE it opens for any records, since I didn’t “enter” the name of client, the main menu finds no records, then it cancels the operation THEN the Name parameter kicks in!
My solution is to add another “field” next to the From Date and To Date and call it “Client Name” or whatever and have the staff enter the name of person and dates at the main form, and it would then enter those parameters before it checks if the records are null. Do you think it will work?
Thanks so much.
-
WSRainyCity4
AskWoody LoungerYeah. Only one query, I’m having problems with. I have it on three other queries and they work perfectly fine.
So, is it something to do with how I designed the query? It is not picking up the dates, somehow?
I’ll look at it tonight, but if I can’t figure anything out, short of sending you the entire database and violating my confidentality agreement with the said agency, how do I show you the query I’m having trouble with?
-
WSRainyCity4
AskWoody LoungerYeah. Only one query, I’m having problems with. I have it on three other queries and they work perfectly fine.
So, is it something to do with how I designed the query? It is not picking up the dates, somehow?
I’ll look at it tonight, but if I can’t figure anything out, short of sending you the entire database and violating my confidentality agreement with the said agency, how do I show you the query I’m having trouble with?
-
WSRainyCity4
AskWoody LoungerThanks. I’ll try that later tonight.
Brent
-
WSRainyCity4
AskWoody LoungerThanks. I’ll try that later tonight.
Brent
-
WSRainyCity4
AskWoody LoungerYeah, it is custom function that I didn’t paste. I’ll paste the entire code so you can see how it works. I am at work right now (The database is an “on the side” work), but will paste the entire code tonight when I get home.
Brent
-
WSRainyCity4
AskWoody LoungerYeah, it is custom function that I didn’t paste. I’ll paste the entire code so you can see how it works. I am at work right now (The database is an “on the side” work), but will paste the entire code tonight when I get home.
Brent
-
WSRainyCity4
AskWoody LoungerMan. You replied so quickly that I didn’t have a chance to edit my original question.
I realized that I forgot to add some pertinent details…
1) It is a saved query
2) The query contains a “code” that basically says that I want all dates from specific date to specific date and it is coded as such: Between FromDate() and ToDate() because the dates I enter is located on the main form as From Date and To Date.
3) I’ve successfully used that very line of code for another query, and it works fine? (It is a crosstab query, might make a difference?)
4) It actually works when I go into Database Window and open the report and it does pull down the correct records according to dates I enter in the Main Menu but when I try to open the report via the Main Menu, it gives me that “You canceled the previous action” error.Brent
-
WSRainyCity4
AskWoody LoungerMan. You replied so quickly that I didn’t have a chance to edit my original question.
I realized that I forgot to add some pertinent details…
1) It is a saved query
2) The query contains a “code” that basically says that I want all dates from specific date to specific date and it is coded as such: Between FromDate() and ToDate() because the dates I enter is located on the main form as From Date and To Date.
3) I’ve successfully used that very line of code for another query, and it works fine? (It is a crosstab query, might make a difference?)
4) It actually works when I go into Database Window and open the report and it does pull down the correct records according to dates I enter in the Main Menu but when I try to open the report via the Main Menu, it gives me that “You canceled the previous action” error.Brent
-
WSRainyCity4
AskWoody LoungerThat teaches me a valuable lesson in NEVER work late in the night !
After waking up after a good night’s sleep, now your suggestions make a lot of sense. I was too tired to notice that you were trying to suggest that I display the minutes in the conventional way (and using Hans’ example).
Also, was too tired to notice that indeed, one bit of code was missing “txt” (txtTotalHours) and that was what caused it to act strangely.
I’ve changed both combo boxes to Fixed format, do I need to change the table properties to Fixed too? (I can’t remember if I had set the Total Hours column to Fixed or not, it is at someone’s PC right now)
Many, many thanks for your help.
![]() |
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 |

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
-
Can’t make Opera my default browser
by
bmeacham
37 minutes ago -
Do not Fall For This Purdentix Scam (Awaiting moderation)
by
elizabethkaur56
3 hours, 11 minutes ago -
*Some settings are managed by your organization
by
rlowe44
13 hours, 10 minutes ago -
Formatting of “Forward”ed e-mails
by
Scott Mills
15 hours, 24 minutes ago -
SmartSwitch PC Updates will only be supported through the MS Store Going Forward
by
PL1
15 hours, 48 minutes ago -
CISA warns of hackers targeting critical oil infrastructure
by
Nibbled To Death By Ducks
1 day ago -
AI slop
by
Susan Bradley
23 hours, 59 minutes ago -
Chrome : Using AI with Enhanced Protection mode
by
Alex5723
1 day, 2 hours ago -
Two blank icons
by
CR2
11 hours, 39 minutes ago -
Documents, Pictures, Desktop on OneDrive in Windows 11
by
ThePhoenix
1 day, 10 hours ago -
End of 10
by
Alex5723
1 day, 13 hours ago -
Single account cannot access printer’s automatic duplex functionality
by
Bruce
11 hours, 34 minutes ago -
test post
by
gtd12345
1 day, 19 hours ago -
Privacy and the Real ID
by
Susan Bradley
1 day, 9 hours ago -
MS-DEFCON 2: Deferring that upgrade
by
Susan Bradley
1 day, 1 hour ago -
Cant log on to oldergeeks.Com
by
WSJonharnew
2 days ago -
Upgrading from Win 10
by
WSjcgc50
11 hours, 44 minutes ago -
USB webcam / microphone missing after KB5050009 update
by
WSlloydkuhnle
15 hours, 18 minutes ago -
TeleMessage, a modified Signal clone used by US government has been hacked
by
Alex5723
2 days, 15 hours ago -
The story of Windows Longhorn
by
Cybertooth
2 days, 3 hours ago -
Red x next to folder on OneDrive iPadOS
by
dmt_3904
2 days, 17 hours ago -
Are manuals extinct?
by
Susan Bradley
3 hours, 16 minutes ago -
Canonical ditching Sudo for Rust Sudo -rs starting with Ubuntu
by
Alex5723
3 days, 2 hours ago -
Network Issue
by
Casey H
2 days, 13 hours ago -
Fedora Linux is now an official WSL distro
by
Alex5723
3 days, 14 hours ago -
May 2025 Office non-Security updates
by
PKCano
3 days, 15 hours ago -
Windows 10 filehistory including onedrive folder
by
Steve Bondy
3 days, 17 hours ago -
pages print on restart (Win 11 23H2)
by
cyraxote
2 days, 18 hours ago -
Windows 11 Insider Preview build 26200.5581 released to DEV
by
joep517
3 days, 19 hours ago -
Windows 11 Insider Preview build 26120.3950 (24H2) released to BETA
by
joep517
3 days, 19 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.