Results 1 to 4 of 4
  1. #1
    forrestapi is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    39

    Problems with database built in 2007 but used in 2003

    Ok first let me say, before i started anything on the data base, i saved it in the 2002-2003 format. Now with that said let me give some details of the problem. (I have highlighted code and errors in red to try and help keep it from being so jumbled)

    1. I have a field identified as "Submitted By" which captures the computer name that the form is being filled out from and automatically populates it. It uses the following module:

    Function udfGetUserName() As String
    On Error GoTo err_udfGetUserName
    Dim strUserName As String
    strUserName = Environ("username")

    exit_udfGetUserName:
    udfGetUserName = strUserName
    Exit Function
    err_udfGetUserName:
    strUserName = ""
    Resume exit_udfGetUserName
    End Function

    Then in the default value field i have :

    =udfGetUserName()

    Now this works fine when working from a computer with access 2007, however in 2003 i get the error :

    Compile Error: Can not find project or library

    When Looking at the debugger it specificlly highlights the Environ in the line strUserName = Environ("username")

    -----------------------------------------------------------------------
    2.I have 2 seperate fields on the form that populate date and time with the following default values

    =Date()
    =Time()

    Again, these work fine in the 2007 version, and not in the 2003. I even went in on a 2003 machine and used the build expression function for date to verify i had the correct formatting, still in these to fields it only gives the following info when the form is started:

    #Name?

    -----------------------------------------------------------------------

    3. I have a Customer Number Combo box the user can select from. On update of that field i have the following lookup preformed to auto populate 3 other fields. The after update code looks like this

    Private Sub Combo165_AfterUpdate()
    Dim HOLD As String
    Text121 = Nz(DLookup("[EMAIL]", "Customers", "[Forms]![ProblemLogCustomer]![Combo165] = NANUM"))
    HOLD = Nz(DLookup("[PHONE]", "Customers", "[Forms]![ProblemLogCustomer]![Combo165] = NANUM"))
    CustPhoneNo = Left(HOLD, 12)
    CustomerContact = Nz(DLookup("[CONTACT]", "Customers", "[Forms]![ProblemLogCustomer]![Combo165] = NANUM"))


    End Sub

    This works great for the 2007 versions, not at all on the 2003. I get the following error:


    Compile Error: Can not find project or library

    With that error it specificly highlights the Left in the following line of code:

    CustPhoneNo = Left(HOLD, 12)





    I understand there is a lot of info listed, and that I may have left out some important parts in trying to describe the problem. Please fill free to ask any questions and i will do my best to anwser them. Just for informational purposes, this is desgined to be a Help Desk/Ticket program for our company to log issues both internally as well as at the customer level. Thanks in advance for any help!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Those functions are all available in 2003, so it is likely a reference problem:

    Access Reference Problems
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    forrestapi is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    39
    I swear you people are like gods on here. Best forum i have ever been apart of. Hopefully as i learn more i can help out some. Thanks again, I will mark this as solved!

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Not really like gods. More like, "made every mistake imaginable so many times we start to remember the solutions".

    Glad it helped you.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. 2003 to 2007
    By Chazcoral in forum Forms
    Replies: 7
    Last Post: 05-25-2010, 10:19 AM
  2. Creating 2003 mde from 2007
    By essaytee in forum Access
    Replies: 2
    Last Post: 12-01-2009, 08:37 AM
  3. Problems with Access 2003\2007 and shared drive
    By swasielewski in forum Access
    Replies: 3
    Last Post: 07-10-2009, 06:32 AM
  4. never built a database
    By g48dd in forum Access
    Replies: 2
    Last Post: 12-08-2008, 10:21 AM
  5. 2007 MDE to be used with 2003
    By Charles Waters in forum Access
    Replies: 1
    Last Post: 07-20-2008, 03:35 PM

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