+ Reply to Thread
Results 1 to 2 of 2

Using dates from a textbox

  1. #1
    Registered User
    Join Date
    07-09-2010
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2003
    Posts
    1

    Using dates from a textbox

    Hi There,
    I am using a form to ask the user for the start date of a mail program. The form has a text box for this entry and a combobox for the month of data to analyze. The 2 dates are compared to get the number of days from the start date to the last day of the month for the month that was chosen. The porblem I am having is the date entered in the text box in the form "mm-dd-yyyy". The end date is defined such as "1/31/2010". When I compare the 2 the are of mismatch data types. What am I doing wrong?

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Using dates from a textbox

    Hello Bigflem,

    You failed to mention or show how you are comparing the two. Both the TextBox and the ComboBox return Strings and not Dates. To compare them as dates, they must first be converted into dates. Here is an example.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1