Results 1 to 8 of 8
  1. #1
    Fairportjay is offline Novice
    Windows 10 Access 2007
    Join Date
    Apr 2019
    Posts
    9

    Functions not working when others use database

    I have a problem :-). I am trying to look up and prepopulate names and departments based on their msid. It works great for me when I sign in and do it from any machine however when others try they get the #name error. this is also the case when I try any "precanned" functions like now or date to prepopulate date and time.. it works perfect when I sign in however others are having issues.


    as you can see I made sure the function is public and I also confirmed it was on other users PC. I am at a complete loos as like I said no functions seem to be working except under my name
    Option Compare Database
    Public Function CU()
    CU = Environ("USERNAME")
    End Function

  2. #2
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,563
    Hi

    Is your database split into FE and BE with a copy of the FE on all users PC's ??

  3. #3
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,411
    you don't appear to be using Option Explicit - not doing so could be hiding errors when you compile

    #Name is something you will see in a form control when the underlying controlsource cannot be identified. So the issue is probably where you are using it, not the code itself. Also the code needs to be in a module - you haven't said whether or not this is the case.

    you haven't declared the function with a datatype, so it will be returning a variant - could also be a problem.

    And have you checked the libraries - as a minimum you need

    Visual Basic for Applications
    Microsoft Access XX.0 Object Library - not sure what XX is for 2007, probably 15
    OLE Automation

  4. #4
    Fairportjay is offline Novice
    Windows 10 Access 2007
    Join Date
    Apr 2019
    Posts
    9
    Mike60smart I am using a shared database. I have it where they just open the database from a shared drive.


    Quote Originally Posted by mike60smart View Post
    Hi

    Is your database split into FE and BE with a copy of the FE on all users PC's ??

  5. #5
    Fairportjay is offline Novice
    Windows 10 Access 2007
    Join Date
    Apr 2019
    Posts
    9
    Its in a module. what I don't get is not a single function will work on their PC's so I am wondering if the libraries are the issue.. I'll look into that next and let you know


    Quote Originally Posted by Ajax View Post
    you don't appear to be using Option Explicit - not doing so could be hiding errors when you compile

    #Name is something you will see in a form control when the underlying controlsource cannot be identified. So the issue is probably where you are using it, not the code itself. Also the code needs to be in a module - you haven't said whether or not this is the case.

    you haven't declared the function with a datatype, so it will be returning a variant - could also be a problem.

    And have you checked the libraries - as a minimum you need

    Visual Basic for Applications
    Microsoft Access XX.0 Object Library - not sure what XX is for 2007, probably 15
    OLE Automation

  6. #6
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,789
    no functions seem to be working except under my name
    Then I would expect Trusted Locations issue. No code can run in a non trusted location, thus no Environ variable thus no function value. You logging in on another pc where the file is local should mean you wouldn't have access to it so I expect the fe copies are on a server.
    Agree with the Ajax's comments too.
    EDIT
    OK last 2 posts weren't there when I started
    The general consensus would be that you're asking for trouble by sharing one non-split db.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  7. #7
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,563
    Hi

    You say "I have it where they just open the database from a shared drive."

    This is a NO NO NEVER when sharing a database.



  8. #8
    Fairportjay is offline Novice
    Windows 10 Access 2007
    Join Date
    Apr 2019
    Posts
    9
    Thank you everyone I split the database and made sure everyone marked it as trusted so it fixed the issues

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

Similar Threads

  1. Expressions and Functions in Query Not Working
    By ItsRoland in forum Queries
    Replies: 6
    Last Post: 07-10-2018, 10:29 AM
  2. Replies: 8
    Last Post: 11-02-2014, 01:27 AM
  3. basic functions are not working in MS Access
    By itm in forum Programming
    Replies: 3
    Last Post: 10-19-2012, 09:58 AM
  4. Replies: 5
    Last Post: 06-29-2011, 01:15 PM
  5. nested functions not working in 2010?
    By Gdm in forum Queries
    Replies: 2
    Last Post: 08-02-2010, 08:02 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