Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    error on calling a function (Access 2K, Win 2KPro, SQL Server 2K)

    I am trying to invoke a function that uses an API call to read the windows login id of current user(s). the function itself is in it's own code module. When I try to call it in code Access says 'Expected Variable or Procedure, not Module' which sounds like I need to "load" the function code as in an include file or something. If I use the macro command RunCode the custom function shows up in the Expression Builder, so it the function itself seems to have compiled alright, but when I try and run the code via a Macro I get "The expression you entered has a function name that Access can't find' which seems to contradict the fact that the function is, in fact, appearing in the Expression Builder.

    ?? <img src=/S/hmmn.gif border=0 alt=hmmn width=15 height=15>

    My suspicion is some kind of scope problem with the function. The function itself needs no arguments, from looking at it. It is supposed to return a $String.

    Any ideas? I'll keep thrashing in the meantime <img src=/S/hairout.gif border=0 alt=hairout width=31 height=23>

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: error on calling a function (Access 2K, Win 2KPro, SQL Server 2K)

    Make sure to give the module a different name than the function. If both are named the same, Access/VBA get confused.

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: error on calling a function (Access 2K, Win 2KPro, SQL Server 2K)

    that seems to have done the trick. muchas gracias! <img src=/S/aussie.gif border=0 alt=aussie width=21 height=22>

Posting Permissions

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