Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Nov 2004
    Location
    London, United Kingdom
    Posts
    152
    Thanks
    0
    Thanked 0 Times in 0 Posts

    cdate type mismatch error (Access 2000)

    The following code is brining up a Type Mismatch error
    cdate("01/04/06")
    I don't understand why this is happening.
    Any advice would be greatly appreciated.

    Amanda

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: cdate type mismatch error (Access 2000)

    Does the problem persist if you quit and restart Access?
    Do you have any missing references in Tools | References in the Visual Basic Editor?

  3. #3
    2 Star Lounger
    Join Date
    Nov 2004
    Location
    London, United Kingdom
    Posts
    152
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: cdate type mismatch error (Access 2000)

    Hans

    Thanks for your reply. Bizzarely there are not missing references and yes the problem does persist if we reboot. Also, a bit of background info, as we are in the Uk here, we had to change the user's regional settings in the Control Panel. The format was correctly selected as English (united Kingdom) however the short date was set to 11/14/2006. We corrected this manually by customising hte short date format. It is strange though that the code works fine with all the other pcs, including mine and that for some reason this computer had a strange short date setting.

    Any suggestions greatly appreciated

    Amanda

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: cdate type mismatch error (Access 2000)

    Whether the date format is mm/dd/yyyy as in the USA, or dd/mm/yyyy as in the UK, CDate("01/04/06") should not cause a type mismatch, since 01/04/06 is a valid (if different) date in both systems. I have no idea why it throws an error. Since this user's settings behave strangely, perhaps his/her account should be recreated from scratch.

  5. #5
    2 Star Lounger
    Join Date
    Nov 2004
    Location
    London, United Kingdom
    Posts
    152
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: cdate type mismatch error (Access 2000)

    Hans thanks for your message.

    We had another look at the regional settings and copied exactly what we had on a pc that worked ok and the problem has been resolved. Strange though as the previous date format was valid.

Posting Permissions

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