Calculate difference in hours in form field.
I am trying to calculate hours worked in a form field.
The formula works fine if hours before noon.
If, however, the second field is after noon, e.g.
17:00, it gives a crazy number, such as -43.00.
Field one (TimeFrom)
Type: Date Format: I have tried both HH:mm and h:mm am/pm
Enable fill-in is checked Calculate on exit is checked
Field two (TimeTo) same as above
Field three (TotalHours)
Type: calculation Format: 0:00
Expression: I have tried everything I can think of:
As I said, if TimeFrom is before noon and TimeTo is before noon, it calculates perfectly.
However, if TimeTo is after noon, even with military time, it does not work.
I have searched and the only thing I can find is for Excel.
That always works properly, but I do not want to do the form in Excel.
Thanks ahead for anyone who can help
Solutions to the Problem Calculate difference in hours in form field.
Replace the last line of Doug's version with
ActiveDocument.FormFields("Text3").Result = Str(ElapsedHours) & "." & Format(ElapsedMinutes * 10 / 6, "00")
This particular error can easily be resolved with a few simple steps. However, if you are not confident in your ability to use the methods below or they do not fully remove the issue on your computer, you may want to seek the assistance of a qualified repair technician who is well versed in fixing Calculate difference in hours in form field..
- Back-up the Registry of your operating system.
- Find the Registry Key: [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\OSUpgrade]
- Note: this Registry Key should already exist, if it does not exist, create it.
- Create a brand new DWORD Value that is named AllowOsUpdate
- Set the Value to 0x00000001.
- Close and reopen your Control Panel.
- Restart the Microsoft Windows.
Recommended Method to Fix the Problem: Calculate difference in hours in form field.:
How to Fix Calculate difference in hours in form field. with SmartPCFixer?
1. You can Download Error Fixer here. Install it on your computer. When you open it, it will perform a scan.
2. After the scan is done, you can see the errors and problems need to be fixed. Click Fix All.
3. The Fixing part is finished, the speed of your computer will be much higher than before and the errors have been fixed.
Related: How to Download Toshiba Portege R500 HDD/SSD Alert Utility v.18.104.22.168 driver,Way to Update & Download Toshiba Satellite A355-S69403 Motorola Modem Region Select Utility v.22.214.171.124 driver,Where to Download Toshiba Satellite L305-S5926 HW Setup Utility v.2.00.11 driver,[Solved] Download Toshiba Satellite L675-S7115 Laptop Checkup v.126.96.36.199 driver,Method to Download Toshiba Satellite M645-S4080 Media Controller v.188.8.131.52 driver,Best Way to Download NVidia GeForce 6100 VGA Driver v.304.51 Certified,How Can You Update & Download NVidia GeForce 9300/nForce 730i VGA Driver v.310.19 Certified,Method to Download NVidia GeForce GT 330M Driver v.340.65,How Can I Update & Download NVidia GeForce GTX 590 Driver v.280.26 WHQL,Method to Download NVidia Tesla C2050 Driver v.319.17
Read More: Troubleshooting:C:\\PROGRA~2\\MICROS~1\\Windows\\mspdb12.dll is either not designed to run on windows or it contains an error.,How to Fix - C++ runtime error while opening OWA session?,Calculate the number of months and days between two dates,Borders print onto labels from merge [Solved],[Solved] boxes around all links as I click them,All diagnostic tools give 0x800700C1, troubleshooting wizard can't continue,all files try to open with adobe,all icons on desktop have changed to Adobe icon and won't open,All functions of my outlook are working except it will not let me "REPLY" or start a "NEW" email,all f1-f12 shortcuts not work