• Missing date function (Access 2K)

    Author
    Topic
    #417590

    For years I have been using the date function i.e. date() in my access databases, and suddenly it won’t recognize it, giving me the message “enter paramater value … date”. Checking the references Ihave the following listed:
    Visual Basic for Applications
    Microsoft Access 9.0 for applications
    OLE Automation
    Microsoft Visual Basic for Applications Extensibility 5.3
    Microsoft DAO 3.6 object library
    Utility

    What am I missing?

    Viewing 0 reply threads
    Author
    Replies
    • #937462

      That sort of message almost always indicates a missing reference of some sort. I presume you don’t have missing for any of the references listed, but are you by chance using Word, Excel or Outlook since you have OLE Automation referenced?

      • #937592

        I often do integrate both excel and word into my work, sending access reports to either, merging docs, etc. I also have Missing:utility, but selecting it and browsing to the location (1033 directory), will fix the “missing” but seems only temporarily, and doesn’t seem to help my reference problem. Why is it being listed as missing when the file is there? Might accessing from different computers cause this? The utility.mda is located on each computer. Does the utility.mda contain the reference I need? is Date() not a VBA function?

        • #937593

          Date is a standard VBA function, but any missing reference will cause VBA not to recognize standard functions such as Date, Left etc. any more.

          Do you really need the reference to Utility.mda? Try clearing this reference altogether and see if the problem goes away.

        • #937610

          As Hans indicates, any missing reference tends to cause VBA functions to fail, though the symptoms often vary in terms of what fails and what doesn’t. We deploy an MDA file with many of our applications, and insist that it be put into a common folder on each workstation, usually on the local C: drive in a root level folder.

          • #937848

            Greetings, my first post!

            I also have a problem with the Date function–it just says it’s NULL when I try to use it. No apparent missing references. I have:

            Visual Basic for Applications
            Microsoft Access 9.0 Object Library
            OLE Automation
            Microsoft ActiveX Data Objects 2.1 Library
            Microsoft DAO 3.6 Object Library

            Access 2K on WinXP.

            Is my problem the same or different??
            kcm549

            • #937850

              Welcome to Woody’s Lounge!

              Check very carefully if you have a field in a table or query named Date, or a global variable in VBA named Date, or if the problem occurs on a form or report, if it contains a control named Date.

            • #937853

              Welcome to the Lounge and to the Access forum – we hope your visit is fruitful.

              I presume you are trying to use it in VBA – if that’s the case you don’t need to reference it as a function – just use the word Date. If on the other hand you are trying to use it in a SQL string (a query), then you should use it like this: Date(). If you are still getting a NULL returned, try the Now() function and see if it gives you the date and the time. Let us know if this solves the problem.

            • #937860

              Interesting…
              Thanks for your quick responses both Wendell AND Hans!
              I DID have a FIELD named “Date,” and so I changed the name of it to eliminate confusion. However that only produced a different error. Then, per Wendell’s suggestion, I used the Now function and that was recognized.

              Why does it recognize Now and not Date I wonder?
              kcm549

            • #937864

              Apparently, the name Date still confuses Access. Without seeing the database it’s hard to say what exactly causes this. If you wish, you can post a stripped down copy of your database so that Loungers can investigate the problem; see post 401925 for instructions.

    Viewing 0 reply threads
    Reply To: Missing date function (Access 2K)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: