You're missing some parens in the calculation.
What is the format of the data in the textboxes?
You're missing some parens in the calculation.
What is the format of the data in the textboxes?
Entia non sunt multiplicanda sine necessitate
time will be entered in the text boxes as (txtstart1) 11:00 (txtend1) 14:00
txtmin1 should then equal 180
ah yes, the parenthesis in the calculation. I havent got that far, I get an error telling me that 11:00 makes a lousy integer.
Heres the actual error I get when I run it
Run-time error '13':
and when I debug, this is highlighted
endnum1 = txtend1.Value
Last edited by iturnrocks; 07-14-2009 at 01:51 PM.
-Dan
www.ksvp.org
That too.
I can't test this at all without making a form, so ...
![]()
Private Sub txtend1_Exit(ByVal Cancel As MSForms.ReturnBoolean) Dim dtEnd As Date Dim dtBeg As Date With frmquota.txtend1 If .Value = "" Then dtEnd = 0 Else If IsDate(.Value) Then dtEnd = CDate(.Value) Else .SetFocus MsgBox "Invalid end time!" End If End If End With With frmquota.txtstart1 If .Value = "" Then dtBeg = 0 Else If IsDate(.Value) Then dtBeg = CDate(.Value) Else .SetFocus MsgBox "Invalid start time!" End If End If End With txtmin1.Value = (dtEnd - dtBeg) * 1440 End Sub
That works great, thank you very much.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks