Results 1 to 17 of 17

Thread: IsDate function

  1. #1

    Thread Starter
    Hyperactive Member Janaka's Avatar
    Join Date
    Nov 2001
    Posts
    277

    Exclamation IsDate function

    Is there a another method for IsDate function?

  2. #2
    Bouncy Member darre1's Avatar
    Join Date
    May 2001
    Location
    Peterborough, UK
    Posts
    3,828
    why would you want to have another method for a perrfectly good function??

    can you give more details please?
    Confucious say, "Man standing naked in biscuit barrel not necessarily ****ing crackers."

    Don't forget to format your code in your posts

  3. #3

    Thread Starter
    Hyperactive Member Janaka's Avatar
    Join Date
    Nov 2001
    Posts
    277
    Ok in my program I have 2 text boxes to get start and end dates
    I use CDate to convert them to date, but the problem it change the format of the data

    If I use IsDate it won’t change but wont convert the text to date.

    Now come to think of it, what I mean to ask was Is there a another method for CDate function

  4. #4
    Si_the_geek
    Guest
    check out the Format function - yuo can specify dd/mm/yyyy or whatever you want

  5. #5

    Thread Starter
    Hyperactive Member Janaka's Avatar
    Join Date
    Nov 2001
    Posts
    277

    Thumbs up


  6. #6

  7. #7
    Bouncy Member darre1's Avatar
    Join Date
    May 2001
    Location
    Peterborough, UK
    Posts
    3,828
    wokka has a point!

    why use textboxes at all, just use a datepicker control or a monthview - basically something where the user can only pick a date, that way there's no room for error
    Confucious say, "Man standing naked in biscuit barrel not necessarily ****ing crackers."

    Don't forget to format your code in your posts

  8. #8
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    Talking It's about time someone ate a whole camel!

    I always have a valid point

    I told my ex, from uni, last night on the fone that I was falling for her again...Ooooooooooooooooops

  9. #9

    Thread Starter
    Hyperactive Member Janaka's Avatar
    Join Date
    Nov 2001
    Posts
    277
    When the dates are far apart the giving date manually is much faster than using DatePicker for a good data entry operator

  10. #10
    Bouncy Member darre1's Avatar
    Join Date
    May 2001
    Location
    Peterborough, UK
    Posts
    3,828
    why not have both then?

    have a textbox with a monthview below it, and make them in tandem with eachother
    Confucious say, "Man standing naked in biscuit barrel not necessarily ****ing crackers."

    Don't forget to format your code in your posts

  11. #11
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632
    Why not have:
    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Form_Load()
    4. Dim lngYear     As Long
    5.     With cboYear
    6.         For lngYear = DatePart("yyyy", Date) - 10 To DatePart("yyyy", Date) + 10
    7.             .AddItem lngYear
    8.             .ItemData(.NewIndex) = lngYear
    9.         Next lngYear
    10.         .ListIndex = .ListCount / 2
    11.     End With
    12. End Sub
    13.  
    14. Private Sub cboYear_Click()
    15.     dtpDate.Year = cboYear.ItemData(cboYear.ListIndex)
    16. End Sub
    Or even have a combo box for month and day as well?
    The thing with typing dates into textboxes is that if your PC is set up to American format (GOD FORBID!) then the date 6/2/2002 is 2nd of June!!! Whereas is the PC is in English then it's 6th of February...This can cause god knows how many problems with an application. Your handling of this format has to be spot on and has to take into account that users are stupid
    Forcing them to pick something is by far the best way to do it.

  12. #12
    Hyperactive Member GlenW's Avatar
    Join Date
    Nov 2001
    Location
    Gateshead, England
    Posts
    479
    Originally posted by Wokawidget
    Whereas is the PC is in English then it's 6th of January...
    you sure about that?

  13. #13

  14. #14
    Bouncy Member darre1's Avatar
    Join Date
    May 2001
    Location
    Peterborough, UK
    Posts
    3,828


    assume the users are stupid eh?

    Last edited by darre1; Apr 29th, 2002 at 08:21 AM.
    Confucious say, "Man standing naked in biscuit barrel not necessarily ****ing crackers."

    Don't forget to format your code in your posts

  15. #15
    Hyperactive Member GlenW's Avatar
    Join Date
    Nov 2001
    Location
    Gateshead, England
    Posts
    479

    Re: Smile, your going to get a carrot...

    Originally posted by Wokawidget
    Nope, I said February...Look above
    Oh! my most humble apologies, I must have read it wrong!

  16. #16

  17. #17
    Bouncy Member darre1's Avatar
    Join Date
    May 2001
    Location
    Peterborough, UK
    Posts
    3,828

    Re: Re: Smile, your going to get a carrot...

    Originally posted by GlenW

    Oh! my most humble apologies, I must have read it wrong!
    me too!

    fancy that!!!!!
    Confucious say, "Man standing naked in biscuit barrel not necessarily ****ing crackers."

    Don't forget to format your code in your posts

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