you don't have to do all that mess
use DateAdd , DateDiff, etc
--but if you're working from text boxes and trying to simulate what vb can
do -
you can use the integer division operator "\" and the "Mod" operator to
divide by 60 and get the remainder
"Dennis D." <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Trying to write an itinerary program.
>
> Got date and time from date time picker
> Converted it to date variables to extract the date and the time
> The form has first a textbox displaying the starting date and time via the
> picker.
> The next few text boxes allow user input of hours and minutes for elapsed
> time of occurring events
> Each text box subtracts or adds from the previous box to reveal a new date
> time
>
> Example:
> The start date is 9/9/2004 2:15:00 AM
> I want to subtract 4 hours and 30 minutes (a changeable user input to a
> textbox) from the start date and produce a new date time (which is
converted
> to a string and output to a display).
>
> The problem: How can I get the minutes to borrow from the hours, and the
> hours to borrow from the date when that is required.
>
> Also, for the output display, is it typical to use a textbox or a label
> control for output results?
>
>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (
http://www.grisoft.com).
Version: 6.0.732 / Virus Database: 486 - Release Date: 7/29/2004