Math Calculations in Unbound Form

reaktorblue

Board Regular
Joined
Aug 8, 2007
Messages
87
Office Version
  1. 365
Platform
  1. Windows
I have a form that has a simple calculation that needs to be done and I was almost certain I was able to do this in an unbound form but I'm not having any luck

I have two values in unbound text boxes that are time. For example:

Text01 "txtTalkTime" = 00:43:13 (The user should enter the amount of time spent talking)
Text02 "txtReadyTime" = 01:35:24 (The user should enter the amount of time spent ready)
Text03 "txtCoverageProvided" = Text01 + Text02 (This should display 02:18:37, adding both the above fields)
Text04 "txtCoverageRequirement" = 04:00:00 (The user should enter the amount of time required)
Text05 "txtCoverageRemaining" = Text04 - Text03 (This should display 01:41:23, subtracting the provide amount of coverage from the requirement)

I didn't think that this was overly complicated, I have this completed in Excel easily but for some odd reason, I'm having quite the challenge of getting this in Access. I think it may be an issue of formatting and the expression used.

Anyone have any advice?
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
I was able to get working. I found the problem. txtCoverageRequirement is supposed to have a default value of 04:00:00 but I entered this wrong. Access did not like the colons however, I found out that with date/time, it needs to be entered as =#4:00:00 AM#. With that update, everything is working smoothly.

My only gripe is my last text box, txtCoverageRemaining, still has the AM/PM when it's clicked into. All of these fields are formatted as hh:nn:ss and when clicked into, do not display the AM/PM. I'm not sure why this one text box displays it when clicked into.
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,717
Members
448,985
Latest member
chocbudda

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top