• WeekdayName Function (Access 97)

    Author
    Topic
    #381048

    I am trying to get a function to work in my form. I have looked at several other posts and have tried different methods, all to no avail. I just want a text box to return the day of the week from another field on the form (Work Date). I have also tried to create another function to find the #day of the week to use as a middle translator between Work Date and the final function.

    =WeekdayName(Weekday([work date]),True) – returns #Name?
    OR
    =WeekdayName([#day of week],true) – returns #Name?

    =Weekday([Work Date]) – this one works fine

    Is there somewhere that I can establish the criteria? I’m not that sure of the expression builder. I am more comfortable in Excel and can do this there with no problem. I am just starting out with “beyond basic” Access. If there is an answer somewhere out there already and someone can point me to it, I will work with that.

    Thanks so much.
    Christine

    Viewing 0 reply threads
    Author
    Replies
    • #640475

      The WeekdayName function was introduced in VB/VBA 6.0 and therefore cannot be used in Access 97, which uses VBA 5.0 as its programming language. As workaround you can use Format function to return long or short weekday name, as illustrated (from Debug window):

      ? Format(Date(),"dddd")
      Monday
      ? Format(Date(),"ddd")
      Mon

      HTH

    Viewing 0 reply threads
    Reply To: WeekdayName Function (Access 97)

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

    Your information: