Results 1 to 5 of 5
  1. #1
    DSTR3 is offline Novice
    Windows XP Access 2002
    Join Date
    Nov 2010
    Location
    NYC-North Jersey
    Posts
    22

    2002 to 2010 Problem

    I'm converting from 2002 to 2010. When I open my 2002 in 2010 my program hangs on this line. Any suggestions on what it may be?


    Thanks
    DS


    TU = Nz(DLookup("TerminalTouch", "tblTerminal", "TerminalName = Environ(""ComputerName"")"), 0)
    If TU = True Then
    DoCmd.OpenForm "frmPointer", , , , , acHidden
    Else
    End If

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    well it doesn't look like the syntax is correct really in the TU' line. and I believe the environ() function should be concatenated out of the doubles. it's possible that 10 doesn't like that. and the other thing too, is that I don't think 2010 is bug free yet, or not even close for that matter. I've had numerous problems with corruption after opening pre-10 versions of database in that program. backup your files before you open them in 2010.

    the corruption only happens though, when you re-open a file in pre-10 after opening it in 10. I've heard numerous other accounts of this happening as well.

  3. #3
    DSTR3 is offline Novice
    Windows XP Access 2002
    Join Date
    Nov 2010
    Location
    NYC-North Jersey
    Posts
    22
    Thank you for the input. Just what I want to hear about 2010! I'm trying to move towards the future but now it looks like I moved too fast!!!!
    Just how would the line read? I'm not sure where the doubles should go.
    DS

  4. #4
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    allen browne uses nested double quotes, and I never understood how people like that can read code that way. I would go crazy determining what is what.

    but it works as well, I just personally don't care for it. I would personally write it like this:

    Code:
    TU = Nz(DLookup("TerminalTouch", "tblTerminal", 
    
    "TerminalName = '" & Environ(6) & "'"), 0)

  5. #5
    DSTR3 is offline Novice
    Windows XP Access 2002
    Join Date
    Nov 2010
    Location
    NYC-North Jersey
    Posts
    22
    Thank you, I will try that. In the meantime I mad a module with the following.....

    'This function is used to allow the use of the Environ function in Access 2003

    Public Function Environ(Expression)
    On Error GoTo Err_Environ

    Environ = VBA.Environ(Expression)

    Exit_Environ:
    Exit Function

    Err_Environ:
    MsgBox Err.Number & " - " & Err.Description
    Resume Exit_Environ

    End Function

    This worked. Apparently Access 2002 doesn't have a "Sandbox Mode" and 2010 does. This caused the problem as it deemed Environ as being an unsafe bit of cade. Thank you for your help.
    DS

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

Similar Threads

  1. Access 2002 to 2007 or 2010
    By DSTR3 in forum Access
    Replies: 2
    Last Post: 11-13-2010, 03:52 PM
  2. Access 2007 to Access 2010 Problem
    By evalmedi in forum Access
    Replies: 1
    Last Post: 10-24-2010, 02:56 PM
  3. Just got Access 2010-run application problem
    By lycialive in forum Forms
    Replies: 0
    Last Post: 07-09-2010, 08:17 PM
  4. Access 2002 ADP application in VSS
    By Accessdev in forum Access
    Replies: 0
    Last Post: 12-16-2009, 12:52 PM
  5. where is access 2002?
    By anon125 in forum Access
    Replies: 1
    Last Post: 08-16-2009, 10:42 AM

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