Results 1 to 5 of 5
  1. #1
    fourboyz is offline Novice
    Windows 11 Access 2016
    Join Date
    Jan 2023
    Posts
    3

    CDate Invalid Use of Null Error


    Getting 'Invalid use of Null' on a cdate expression. How do I fix this?

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,903
    Use the NZ() funcrion and a default date?
    Or check it is a date with IsDate()
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    fourboyz is offline Novice
    Windows 11 Access 2016
    Join Date
    Jan 2023
    Posts
    3
    Quote Originally Posted by Welshgasman View Post
    Use the NZ() funcrion and a default date?
    Or check it is a date with IsDate()

    Thank you! Is working now!

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,903
    Quote Originally Posted by fourboyz View Post
    Thank you! Is working now!
    Well please show the end result. It could help others in the future.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  5. #5
    fourboyz is offline Novice
    Windows 11 Access 2016
    Join Date
    Jan 2023
    Posts
    3
    Quote Originally Posted by Welshgasman View Post
    Well please show the end result. It could help others in the future.
    Large table of over 45K lines - needed data only within my date parameters of 10/1/2022 And 12/30/2022
    Found have null values in the date field.
    Used following formula in the date Field to fix the issue:
    IIf(IsNull([FieldName])=False,CDate([FieldName]),#1/1/1900#) used >=#10/1/2022# And <=#12/30/2022# as the Criteria

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Run time error '94' Invalid use of Null
    By Canadiangal in forum Access
    Replies: 2
    Last Post: 10-21-2020, 03:53 PM
  2. Replies: 3
    Last Post: 05-10-2018, 07:48 AM
  3. Invalid use of NULL error
    By CHEECO in forum Access
    Replies: 13
    Last Post: 03-16-2016, 07:20 PM
  4. CDate and CStr issue with "Invalid Use of Null" Issue
    By excellenthelp in forum Queries
    Replies: 3
    Last Post: 07-25-2014, 01:34 PM
  5. Error 94: Invalid Use of Null
    By athomas8251 in forum Forms
    Replies: 3
    Last Post: 11-09-2011, 11:46 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums