-
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
-
Practice what you preach! A cautionary tale.
by
RetiredGeek
2 hours, 38 minutes ago -
Looking for Microsoft Defender Manuals/Tutorial
by
blueboy714
22 hours, 30 minutes ago -
Win 11 24H2 Home or Pro?
by
CWBillow
8 hours, 51 minutes ago -
Bipartisan Effort to Sunset the ‘26 Words That Created the Internet’..
by
Alex5723
1 day, 6 hours ago -
Outlook new and edge do not load
by
cHJARLES a pECKHAM
1 day, 18 hours ago -
Problem using exfat drives for backup
by
Danmc
1 day, 19 hours ago -
I hate that AI is on every computer we have!
by
1bumthumb
21 hours, 11 minutes ago -
Change Info in the Settings window
by
CWBillow
2 days, 1 hour ago -
Attestation readiness verifier for TPM reliability
by
Alex5723
2 days, 8 hours ago -
Windows Update says that “some settings are managed b your organization”
by
Ed Willers
1 day, 18 hours ago -
Use of Gmail rejected.
by
CBFPD-Chief115
1 day, 18 hours ago -
WuMgr operational questions
by
Tex265
20 hours, 29 minutes ago -
Beijing’s unprecedented half-marathon: Humans vs. humanoids!
by
Alex5723
2 days, 23 hours ago -
New Phishing Campaign Targeted at Mac Users
by
Alex5723
2 days ago -
Backing up Google Calendar
by
CWBillow
3 days, 6 hours ago -
Windows 11 Insider Preview build 27818 released to Canary
by
joep517
3 days, 18 hours ago -
File Naming Conventions (including Folders)
by
Magic66
2 days, 17 hours ago -
Windows 11 Insider Preview Build 26100.3613 (24H2) released to Release Preview
by
joep517
4 days, 2 hours ago -
Microsoft sends emails to Windows 10 users about EOS
by
Alex5723
3 days, 12 hours ago -
Outlook 2024 importing Calendar and Contacts – FAILURE
by
Kathy Stevens
2 days, 18 hours ago -
Adding Microsoft Account.
by
DaveBRenn
4 days, 3 hours ago -
Windows 11 Insider Preview build 26120.3576 released to DEV and BETA
by
joep517
5 days, 3 hours ago -
Windows 11 Insider Preview Build 22635.5090 (23H2) released to BETA
by
joep517
5 days, 3 hours ago -
Windows 11 won’t boot
by
goducks25
2 days, 19 hours ago -
Choosing virtual machine product for Windows on Mac
by
peterb
4 days, 17 hours ago -
Rest in Peace
by
Roy Lasris
5 days, 21 hours ago -
CISA : Install Windows March 2025 Updates until April 1 or shut down PC.
by
Alex5723
2 days, 19 hours ago -
Google proposes users with incompatible Win 11 PCs to migrate to ChromeOS Flex
by
Alex5723
5 days, 22 hours ago -
Drivers for Epson Perfection V600 Photo – scanner
by
Bookman
2 days, 13 hours ago -
Long Time Member
by
jackpet
6 days 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.