EVAL function (1 Viewer)

el.alcalde

Registered User.
Local time
Today, 08:42
Joined
Apr 27, 2018
Messages
14
Hello everybody, since 2 weeks we have updated our Microsoft Office 2013 Service Pack 1Access 2013, the update was isuued in 13 March 2018.

Anyway, after the update the Function EVAL ("DATE()") does not function any more, get an error number 2426.

Before the update it gave today's date.

Have anybody faced such thing.
Thanks and have a nice day.
 
Last edited:

June7

AWF VIP
Local time
Today, 07:42
Joined
Mar 9, 2014
Messages
5,501
Why do you wrap Date() function within Eval()?
 

isladogs

MVP / VIP
Local time
Today, 16:42
Joined
Jan 14, 2017
Messages
18,267
June beat me to it

Eval("Date()") gives exactly the same result as Date()
No point wrapping it.
Similarly for Now() and Eval("Now")

But I tested in A2016 and both still work
 

el.alcalde

Registered User.
Local time
Today, 08:42
Joined
Apr 27, 2018
Messages
14
I have Many orders, every order has a dead date, one or many action queries, reports and so on.

I store all these information in a global type

Therefroe I have to retreive the date value through the eval function.
 

el.alcalde

Registered User.
Local time
Today, 08:42
Joined
Apr 27, 2018
Messages
14
Thanks ridders and June7
I don not have office 2016, we run office 2013 and just updated 2 weeks ago, we still have office 2013
I tested it on a pc of my collage, whos pc was not updated, it functions on his pc
but on mine no.
 

Attachments

  • eval_Error.PNG
    eval_Error.PNG
    22.1 KB · Views: 68

June7

AWF VIP
Local time
Today, 07:42
Joined
Mar 9, 2014
Messages
5,501
I still don't understand why you are wrapping Date() in Eval().
 

el.alcalde

Registered User.
Local time
Today, 08:42
Joined
Apr 27, 2018
Messages
14
I am using a global type called Order
Code:
 Type Order
    ID                         As Integer
    Name                   As String
    SelectQueries()   As String
    ActionQueries()   As String
    ExtraQuery()        As String
    deadDate()          As String
    
    ResultedTables()  As String
    DelTempTable       As Boolean
    Forms()                As String
    Reports()             As String
    FixedCriteria()     As String
    Functions()          As String
    Secure                  As String
    View                     As Byte
    Temps()               As String    ' Any other parameter can be passed through this one
    CreatedOn()         As String     ' When the order was entered or modifyed
    disabled()             As String     ' array to enter the disabled objects
    invisible()            As String       ' array to enter the invisible objects
    PivoFields            As String      ' Pivot Table Fields to form the pivot table
    renameME()        As String      ' for any other field (later will be renaimed)
 End Type
in the deadDate() array of the type, I can put my dead dates as strings
i.e "DateSerial(Year(Date()),Month(Date()),1);DATE()"

on my Form I split this array and put the evaluated values in a drop down list
It has always been functioning till this update.

I hope I could explain it
 
Last edited:

isladogs

MVP / VIP
Local time
Today, 16:42
Joined
Jan 14, 2017
Messages
18,267
Well I've read that and I also still don't understand why you are using Eval
 

el.alcalde

Registered User.
Local time
Today, 08:42
Joined
Apr 27, 2018
Messages
14
in order to evaluate the string value "DateSerial(Year(Date()),Month(Date()),1)"
or "DATE()"

What else could be used?
 

el.alcalde

Registered User.
Local time
Today, 08:42
Joined
Apr 27, 2018
Messages
14
I want to put these date values in a list box whose RowSourceType is a value list
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 11:42
Joined
May 21, 2018
Messages
8,629
I cannot help on the service patch issue, but since it was a security update I can see how the eval function could have been impacted depending on your version of Windows and Office.
However, this seems very Rude Goldbergish
in the deadDate() array of the type, I can put my dead dates as strings
i.e "DateSerial(Year(Date()),Month(Date()),1);DATE ()"
If you can populate your custom type with the correct strings why can't you not put in the actual dates. Or at least put in something like "FirstOfMonth";"Today" and then use a select case to determine the value. If you really need to do this, you really should consider a custom class. You are really limited by the UDT.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 11:42
Joined
Feb 19, 2002
Messages
43,560
Eval() broke for me early in June. I was lucky because I didn't need to fix the problem. I could wait until the fix got to me. My app is working again as if by magic.

See if you can change your update cycle to get the fix.
 

el.alcalde

Registered User.
Local time
Today, 08:42
Joined
Apr 27, 2018
Messages
14
Thanks a lot for your answers, I have to wait till our system people get the fix

Any way have a nice day
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 11:42
Joined
May 21, 2018
Messages
8,629
I have to wait till our system people get the fix
Or maybe just fix this overly complicated bizarre approach. Just a thought.
 

Users who are viewing this thread

Top Bottom