Results 1 to 15 of 15
  1. #1
    visions is offline Novice
    Windows Vista Access 2007
    Join Date
    Dec 2014
    Posts
    11

    can't trace function call

    Hello,

    I'm new to Access and inherited someone's database.
    While doing some tinkering, I clicked the search button on a form
    and tried tracing the code in debug mode.

    The search button's code immediately calls another form with:

    Code:
    DoCmd.OpenForm "Form2", acNormal
    However, once this line executes, two functions in a module named
    mod_querydefs are executed before control goes to Form2 code.

    I don't understand what calls these functions and why they are executed
    before Form2 code. If I comment one of them out, I get run-time error 3085
    "Undefined Function function X in Expression". This is strange.

    And if I do a stack trace while I'm in one of the functions, I get this:

    functionX()
    <non-basic code>
    Frm1_Btn_click()

    I'm not sure if "non-Basic code" is hidden code which is calling these functions.


    All I can say is that this is pretty damn confusing.

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    See if they are called from a query the form being opened is based on.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    visions is offline Novice
    Windows Vista Access 2007
    Join Date
    Dec 2014
    Posts
    11
    thanks pbaldy. how would I do that?

  4. #4
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Either look through the fields in design view or SQL view. What is the record source of the form?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    What is the form RecordSource - table, query, SQL statement? If it is query or SQL statement the functions could be called by expressions.

    I use Rick Fisher's Find and Replace add-in to track down issues like this. Saved my sanity more than once. Cost about $50.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    visions is offline Novice
    Windows Vista Access 2007
    Join Date
    Dec 2014
    Posts
    11
    thanks guys. sorry for the late response. between work, opposite time zones, and connectivity issues its hard to respond.
    anyway, I checked the form record source and it was a query. That takes care of one of the functions being called, but that query doesn't contain any calls to the second function. I'm hopeful I'll figure it out.

  7. #7
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Does the query reference another query? Can you post the db here?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #8
    visions is offline Novice
    Windows Vista Access 2007
    Join Date
    Dec 2014
    Posts
    11
    I don't think it references another query, but i'll try to post it tomorrow (it's bed time where I'm at).
    appreciate your help.

  9. #9
    visions is offline Novice
    Windows Vista Access 2007
    Join Date
    Dec 2014
    Posts
    11
    I will probably get in trouble if i post the database, but perhaps I can post a form if needed.
    As I mentioned earlier, the record source property caused that form to be dependent on a query.
    However, there is another query which this form depends on, and I can't trace it. I tried the "build event" option when I right
    click on the form in design mode, but I saw nothing there.

    I verified the dependencies using the dependency tool in Access.

    Access's design is ticking me off.
    Last edited by visions; 12-27-2014 at 07:11 AM. Reason: added info

  10. #10
    visions is offline Novice
    Windows Vista Access 2007
    Join Date
    Dec 2014
    Posts
    11
    Also, the first query does not reference another query.

  11. #11
    visions is offline Novice
    Windows Vista Access 2007
    Join Date
    Dec 2014
    Posts
    11
    I'll try to get Rick Fisher's tool...
    This dependency issue is a huge flaw of Access.

  12. #12
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I've heard good things about a free utility called V Tools and it has a deep search tool.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  13. #13
    visions is offline Novice
    Windows Vista Access 2007
    Join Date
    Dec 2014
    Posts
    11
    ok i'll check it out

  14. #14
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    What, if any code, is in the Form_Open and Form_Load events?

    In Form Design View, if you go to Properties - Data is anything listed in the Filter or OrderBy properties?

    All of these will execute before you 'see' the Form.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  15. #15
    visions is offline Novice
    Windows Vista Access 2007
    Join Date
    Dec 2014
    Posts
    11
    Quote Originally Posted by Missinglinq View Post
    What, if any code, is in the <strong>Form_Open </strong>and <strong>Form_Load</strong> events?<br>
    <br>
    In <strong>Form Design View</strong>, if you go to <strong>Properties - Data</strong> is anything listed in the <strong>Filter</strong> or <strong>OrderBy</strong> properties?<br>
    <br>
    All of these will execute before you 'see' the <strong>Form</strong>.<br>
    <br>
    Linq <strong>;0)&gt;</strong>
    <br>
    <br>
    The Form_Load event does not contain the query in question, further the query executes before Form_Load executes...<br><br>I check Properties-Data, and nothing is there.<br><br>Perhaps I shouldn't dwell too much on this because the execution of that query apparently doesn't have any negative effects.<br><br>Appreciate the help.<br><br>

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

Similar Threads

  1. Function call in query slowing it down
    By sneuberg in forum Queries
    Replies: 2
    Last Post: 10-17-2014, 10:32 AM
  2. Call A function
    By aspen in forum Programming
    Replies: 10
    Last Post: 03-16-2014, 12:57 PM
  3. Trace not matching code
    By Buakaw in forum Programming
    Replies: 2
    Last Post: 07-21-2011, 01:59 AM
  4. Silly error on a simple function call - help
    By allenjasonbrown@gmail.com in forum Programming
    Replies: 5
    Last Post: 06-10-2011, 01:23 PM
  5. Replies: 5
    Last Post: 07-13-2010, 11:48 AM

Tags for this Thread

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