-
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.
-
WSRainyCity4
AskWoody LoungerThis is pretty new for me (setting rst and dbs to nothing), what’s the syntax? I tried rst = Nothing and got an error.
-
WSRainyCity4
AskWoody LoungerThis is pretty new for me (setting rst and dbs to nothing), what’s the syntax? I tried rst = Nothing and got an error.
-
WSRainyCity4
AskWoody LoungerPat,
If I set both dbs and rs to Nothing at the end of the code, wouldn’t this clear out the stored values? That bit of code actually stores the dates that I enter in a form and I pull those dates from the “stored” values and put them in the reports I need.
By setting dbs and rs to Nothing at the end of the code, wouldn’t that cause the FromDate() and ToDate() to “lose” the stored values?
Hans, thanks for your tip.
-
WSRainyCity4
AskWoody LoungerPat,
If I set both dbs and rs to Nothing at the end of the code, wouldn’t this clear out the stored values? That bit of code actually stores the dates that I enter in a form and I pull those dates from the “stored” values and put them in the reports I need.
By setting dbs and rs to Nothing at the end of the code, wouldn’t that cause the FromDate() and ToDate() to “lose” the stored values?
Hans, thanks for your tip.
-
WSRainyCity4
AskWoody LoungerLink to MSKB article provided by mod – see Help 19
I’m using Helen Feddema’s Main Form Add-In and I was trying to use a part of her code called FromDate() and ToDate() and tried to use it in a crosstab query and when I did that, now when I open the crosstab query either by itself or in a report, I can’t close the Access program. It would “reopen” to a blank Access window. Only by removing those references in the query, I can stop the behavior.
I found this Microsoft Knowledge Base Article 164455 which pretty much describes my issue. Helen’s original code had “.Close” statements, I changed it to “rst.close” and it didn’t solve it. Can anyone help me fix the code so that it would force the recordset to close so that I can quit Access?
Here’s the code that Helen wrote (original, without my pitiful attempts to fix it).
Public Function ToDate() As Date
‘Written by Helen Feddema 9/14/98
‘Last modified 7-4-2002On Error GoTo ErrorHandler
‘Pick up To date from Info table
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset(“tblInfo”, dbOpenTable)
With rst
.MoveFirst
ToDate = Nz(![ToDate], “12/31/2004”)
.Close
End WithErrorHandlerExit:
Exit FunctionErrorHandler:
MsgBox “Error No: ” & Err.Number & “; Description: ” & _
Err.Description
Resume ErrorHandlerExitEnd Function
-
WSRainyCity4
AskWoody LoungerLink to MSKB article provided by mod – see Help 19
I’m using Helen Feddema’s Main Form Add-In and I was trying to use a part of her code called FromDate() and ToDate() and tried to use it in a crosstab query and when I did that, now when I open the crosstab query either by itself or in a report, I can’t close the Access program. It would “reopen” to a blank Access window. Only by removing those references in the query, I can stop the behavior.
I found this Microsoft Knowledge Base Article 164455 which pretty much describes my issue. Helen’s original code had “.Close” statements, I changed it to “rst.close” and it didn’t solve it. Can anyone help me fix the code so that it would force the recordset to close so that I can quit Access?
Here’s the code that Helen wrote (original, without my pitiful attempts to fix it).
Public Function ToDate() As Date
‘Written by Helen Feddema 9/14/98
‘Last modified 7-4-2002On Error GoTo ErrorHandler
‘Pick up To date from Info table
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset(“tblInfo”, dbOpenTable)
With rst
.MoveFirst
ToDate = Nz(![ToDate], “12/31/2004”)
.Close
End WithErrorHandlerExit:
Exit FunctionErrorHandler:
MsgBox “Error No: ” & Err.Number & “; Description: ” & _
Err.Description
Resume ErrorHandlerExitEnd Function
-
WSRainyCity4
AskWoody LoungerJohn,
You have been a huge help!
I have few issues that I need your help with:
1) When you said to do this: Set the Row Source for cboQuarters to 0;0;.25/;1;.5;2;.75;3 and when I set the first column width to zero, the drop-down list shows 0,1, 2, 3 instead of .25, .5, .75. Is this intentional? Also, is the slash next to .25 a typo? Also, why do I need the “hidden” values of 0,1,2,3 when I don’t need it for cboHours? (I’m interested in learning how this process works)
2) When I enter this: “Hours: 1, Minutes: 0”, the TotalHours field shows 10 hours instead of 1.0? (I’m gonna try adding a period next to 0 which will work…) (EDIT: This worked. No need to worry about it anymore.)
3) When I enter something like “Hours: 1, Minutes: .25”, the TotalHours field shows 1.25, great…Then when I advance a record then go back one record or more to correct my previous entries, it shows combo boxes as “Hours: 1, Minutes: 0” but the TotalHours field shows 1.25. I’d like for the cboMinutes to continue showing the minutes I chose rather than resetting to zero (the cboHours does not reset even if I choose something like 3).
-
WSRainyCity4
AskWoody LoungerJohn,
You have been a huge help!
I have few issues that I need your help with:
1) When you said to do this: Set the Row Source for cboQuarters to 0;0;.25/;1;.5;2;.75;3 and when I set the first column width to zero, the drop-down list shows 0,1, 2, 3 instead of .25, .5, .75. Is this intentional? Also, is the slash next to .25 a typo? Also, why do I need the “hidden” values of 0,1,2,3 when I don’t need it for cboHours? (I’m interested in learning how this process works)
2) When I enter this: “Hours: 1, Minutes: 0”, the TotalHours field shows 10 hours instead of 1.0? (I’m gonna try adding a period next to 0 which will work…) (EDIT: This worked. No need to worry about it anymore.)
3) When I enter something like “Hours: 1, Minutes: .25”, the TotalHours field shows 1.25, great…Then when I advance a record then go back one record or more to correct my previous entries, it shows combo boxes as “Hours: 1, Minutes: 0” but the TotalHours field shows 1.25. I’d like for the cboMinutes to continue showing the minutes I chose rather than resetting to zero (the cboHours does not reset even if I choose something like 3).
-
WSRainyCity4
AskWoody LoungerJohn,
Thanks. I didn’t realize that Hans’ solution had assumed I would be using Date/Time format. I was using Number format for the field.
-
WSRainyCity4
AskWoody LoungerJohn,
Thanks. I didn’t realize that Hans’ solution had assumed I would be using Date/Time format. I was using Number format for the field.
-
WSRainyCity4
AskWoody LoungerThanks, Hans.
One quick question. Where do I store the code for Private Sub UpdateTime()?
-
WSRainyCity4
AskWoody LoungerThanks, Hans.
One quick question. Where do I store the code for Private Sub UpdateTime()?
-
WSRainyCity4
AskWoody LoungerActually, I was at a loss of words. Smile.
By “column”, I meant the field in the table. There is a field called “TotalHours” and it stores hours and its fractions such as 1, 1.25, etc. and by using separate combo boxes, I’d be forced to create two fields called Hours and Minutes, making it extremely difficult for me to do calculations on these fields.
I’d rather to have one field that stores both hours and minutes, I’ve found one solution but it works only with dates. If you could help me figure out how to combine two “unbound” combo boxes into one field, that’d be great.
-
WSRainyCity4
AskWoody LoungerActually, I was at a loss of words. Smile.
By “column”, I meant the field in the table. There is a field called “TotalHours” and it stores hours and its fractions such as 1, 1.25, etc. and by using separate combo boxes, I’d be forced to create two fields called Hours and Minutes, making it extremely difficult for me to do calculations on these fields.
I’d rather to have one field that stores both hours and minutes, I’ve found one solution but it works only with dates. If you could help me figure out how to combine two “unbound” combo boxes into one field, that’d be great.
![]() |
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
-
Global data centers (AI) are driving a big increase in electricity demand
by
Kathy Stevens
10 hours, 8 minutes ago -
Office apps read-only for family members
by
b
12 hours, 44 minutes ago -
Defunct domain for Microsoft account
by
CWBillow
9 hours, 36 minutes ago -
24H2??
by
CWBillow
1 hour, 30 minutes ago -
W11 23H2 April Updates threw ‘class not registered’
by
WindowsPersister
21 hours, 29 minutes ago -
Master patch listing for April 8th, 2025
by
Susan Bradley
14 hours, 43 minutes ago -
TotalAV safety warning popup
by
Theodore Nicholson
9 hours, 32 minutes ago -
two pages side by side land scape
by
marc
2 days, 10 hours ago -
Deleting obsolete OneNote notebooks
by
afillat
2 days, 12 hours ago -
Word/Outlook 2024 vs Dragon Professional 16
by
Kathy Stevens
1 day, 15 hours ago -
Security Essentials or Defender?
by
MalcolmP
1 day, 18 hours ago -
April 2025 updates out
by
Susan Bradley
24 minutes ago -
Framework to stop selling some PCs in the US due to new tariffs
by
Alex5723
1 day, 11 hours ago -
WARNING about Nvidia driver version 572.83 and 4000/5000 series cards
by
Bob99
1 day, 1 hour ago -
Creating an Index in Word 365
by
CWBillow
2 days, 4 hours ago -
Coming at Word 365 and Table of Contents
by
CWBillow
16 hours, 16 minutes ago -
Windows 11 Insider Preview Build 22635.5170 (23H2) released to BETA
by
joep517
3 days, 7 hours ago -
Has the Microsoft Account Sharing Problem Been Fixed?
by
jknauth
3 days, 11 hours ago -
W11 24H2 – Susan Bradley
by
G Pickerell
3 days, 12 hours ago -
7 tips to get the most out of Windows 11
by
Alex5723
3 days, 10 hours ago -
Using Office apps with non-Microsoft cloud services
by
Peter Deegan
3 days, 4 hours ago -
I installed Windows 11 24H2
by
Will Fastie
1 day, 10 hours ago -
NotifyIcons — Put that System tray to work!
by
Deanna McElveen
3 days, 16 hours ago -
Decisions to be made before moving to Windows 11
by
Susan Bradley
9 hours, 41 minutes ago -
Port of Seattle says ransomware breach impacts 90,000 people
by
Nibbled To Death By Ducks
4 days ago -
Looking for personal finance software with budgeting capabilities
by
cellsee6
3 days, 8 hours ago -
ATT/Yahoo Secure Mail Key
by
Lil88reb
3 days, 9 hours ago -
Devices with apps using sprotect.sys driver might stop responding
by
Alex5723
4 days, 17 hours ago -
Neowin – 20 times computers embarrassed themselves with public BSODs and goofups
by
EP
5 days, 2 hours ago -
Slow Down in Windows 10 performance after March 2025 updates ??
by
arbrich
1 day, 1 hour 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.