Results 1 to 6 of 6
  1. #1
    4 Star Lounger
    Join Date
    Mar 2005
    Location
    Leicestershire, United Kingdom
    Posts
    505
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Error 3085 Undefined function 'Environ' in expression

    Hi,

    We currently have an Access 2000 front end and wanting to go to Access 2013.

    When loading our form in a query there above error message appears.

    Any ideas why?
    Last edited by Kathleen Atkins; 2014-03-25 at 14:30.
    Best Regards,

    Luke

  2. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    5,957
    Thanks
    193
    Thanked 730 Times in 666 Posts
    Luke,

    I'm just guessing here since I don't have Access 2000 to check.
    Environ is a built-in function, in Access 2003 and newer, that returns the value of an Environment Variable.
    Ex:
    ?Environ("UserName")
    Bruce

    If as the message suggests someone built a User-Defined Function in Access 2000 because that version did NOT contain the built-in version it could be causing a conflict in the new version that does have the built-in version. You'll need to check the code for the database in the VBE (Visual Basic Environment) {Alt+F11}.
    Once there do a search for Environ. HTH
    May the Forces of good computing be with you!

    RG

    VBA Rules!

    My Systems: Desktop Specs
    Laptop Specs


  4. #3
    4 Star Lounger
    Join Date
    Mar 2005
    Location
    Leicestershire, United Kingdom
    Posts
    505
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It returns the value in VBA, but in the query it causes the issue
    Best Regards,

    Luke

  5. #4
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    5,957
    Thanks
    193
    Thanked 730 Times in 666 Posts
    Luke,

    Could you post a screen shot of the query design window making sure the column with the offending statement is wide enough to show everything in it?
    May the Forces of good computing be with you!

    RG

    VBA Rules!

    My Systems: Desktop Specs
    Laptop Specs


  6. #5
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    5,957
    Thanks
    193
    Thanked 730 Times in 666 Posts
    Luke,

    Environ is not available in the Query Expression builder!
    You can get around this by building your own UDF (User Defined Function)
    Code:
    Function zMyEnvVar(zEnvName As String) As String
    
        zMyEnvVar = Environ(zEnvName)
        
    End Function  'zMyEnvVar
    Just place the above code in a standard module then call it from your query like this:
    Userid: zMyEnvVar("UserName")
    It works just fine:
    UDFEnviron.JPG
    HTH
    May the Forces of good computing be with you!

    RG

    VBA Rules!

    My Systems: Desktop Specs
    Laptop Specs


  7. #6
    4 Star Lounger
    Join Date
    Mar 2005
    Location
    Leicestershire, United Kingdom
    Posts
    505
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Okay, will give a try, thank you
    Best Regards,

    Luke

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •