Results 1 to 4 of 4
  1. #1
    visions is offline Novice
    Windows Vista Access 2007
    Join Date
    Dec 2014
    Posts
    11

    eval() ignores everything after '!" or '.' in argument

    Hello,I tried using eval() like this:


    Code:
    eval("AB16_" & "Total.value")
    But, Access ignores the dot and everything after it so that my statement in effect becomes:
    Code:
    eval("AB16_Total")
    I did not expect this and can't find documentation regarding this. Further, if I replace the dot with a "!" I get the same result.

    Thanks for the help.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    I don't think that is correct use of Eval().

    Eval() will take a string of characters like: "5 ^ 3 / 4" and do the math.

    If you want to concatenate the content of Total to the string "AB16_", then try:

    "AB16_" & [Total]

    Where are you doing this calc - in query, in textbox, in VBA?

    What are you really trying to accomplish?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Assuming that Total, or AB16_Total is a Textbox, on your Form, it doesn't really matter. Since .Value is the Default Property of a Textbox, in VBA

    AB16_Total.Value

    and

    AB16_Total

    means the exact same thing! But like June7, I not sure that this is a valid use of Eval()! What would typical data in this Control look like?

    Linq ;0)>

  4. #4
    visions is offline Novice
    Windows Vista Access 2007
    Join Date
    Dec 2014
    Posts
    11
    Quote Originally Posted by Missinglinq View Post
    Assuming that Total, or AB16_Total is a Textbox, on your Form, it doesn't really matter. Since .Value is the Default Property of a Textbox, in VBA

    AB16_Total.Value

    and

    AB16_Total

    means the exact same thing! But like June7, I not sure that this is a valid use of Eval()! What would typical data in this Control look like?

    Linq ;0)>


    Thanks June7 and Missinglinq.
    That the default property of a control is value takes care of my question

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

Similar Threads

  1. Replies: 3
    Last Post: 07-19-2014, 01:15 PM
  2. Replies: 5
    Last Post: 06-26-2013, 02:29 PM
  3. Replies: 4
    Last Post: 06-24-2013, 07:12 AM
  4. table field name "Year" causing Argument Not Optional
    By JosmithTwo in forum Programming
    Replies: 2
    Last Post: 09-26-2012, 08:01 PM
  5. Replies: 6
    Last Post: 08-23-2012, 05:06 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