I'm having some really weird returns that don't make any sense whatsoever and don't even add up correctly. I've had no luck reading through pages and pages of google searches looking for the solution.
I have two text fields on my form.. txtTime1 and txtTime2. Both are set for Short Time format, I have an unbound field, txtOutput from which I want the difference displayed. All three fields on the corresponding table are date/time fields. I want the output displayed as hh:mm in txtOutput.
I've tried:
Which doesn't even add up...at all or depending on how I changed field types and field formats, I get either runtime errors saying values aren't right or just strange numbers in general.
I've tried all sorts of other combinations that I can't remember off hand.
I don't know if my format is wrong, my field types are wrong, the code is wrong, the calculations are wrong. No idea.
Any ideas?
I have two text fields on my form.. txtTime1 and txtTime2. Both are set for Short Time format, I have an unbound field, txtOutput from which I want the difference displayed. All three fields on the corresponding table are date/time fields. I want the output displayed as hh:mm in txtOutput.
I've tried:
Code:
Dim Boop As Integer
Dim Beep As Integer
Boop = DateDiff("h", txtTime1, txtTime2)
Beep = DateDiff("n", txtTime1, txtTime2) Mod 60
Me.txtOutput = Boop & ":" & Beep
I've tried all sorts of other combinations that I can't remember off hand.
I don't know if my format is wrong, my field types are wrong, the code is wrong, the calculations are wrong. No idea.
Any ideas?