Results 1 to 2 of 2

Thread: Combining text boxes

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 1999
    Location
    St. Louis, MO USA
    Posts
    21

    Post

    I have two date text boxes and two time text boxes (Start and stop date and time). I need to combine the text of start date and start time to compare with stop date and stop time.

    Any Suggestions on how to combine the two text boxes?

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,176

    Post

    Use the CDate Function and Combine the Date and Time Textboxes together as a String, eg.
    Code:
    Private Sub Command1_Click()
        MsgBox "Time Difference is " & DateDiff("n", CDate(txtDate1 & " " & txtTime1), CDate(txtDate2 & " " & txtTime2)) & " Minutes"
    End Sub
    ------------------
    Aaron Young
    Analyst Programmer
    aarony@redwingsoftware.com
    adyoung@win.bright.net

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width