Results 1 to 6 of 6
  1. #1
    schulzy175 is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Oct 2017
    Posts
    98

    The Statement That You Entered Has A Function Name That Microsoft Access Can't Find


    I got this to work yesterday. But I have 2 databases. Database9 and Database10. Both are located in Documents. I can run a macro in Database9, but not in Database10. I get this error on Database 10 even if the only string I have is
    Code:
    msgbox "hi"
    . I used the most simplest form of code to try and debug this, but I have not found the answer anywhere on google.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    that is a legal command. That means the problem could be:
    1. the database size is almost at 2 gig. Strange messages occur at this point.
    2. there is a missing reference in VBE that is causing this.
    3. the db is corrupt. Did you try compact /repair?

  3. #3
    schulzy175 is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Oct 2017
    Posts
    98
    I did compact and repair, but still get the message. Now I have imported 2 ODBC connections to Database10. Our main DB and then QODBC. So it may be getting too large. To be more clear with my code, here is exactly what I have.
    Code:
    Function TestFunction()
    
    MsgBox "hi"
    
    
    End Function

  4. #4
    schulzy175 is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Oct 2017
    Posts
    98
    Ok, so this doesn't make sense to me, but if I change the function name from
    Code:
    TestFunction()
    to
    Code:
    Trun2()
    then the code actually runs?! I am confused.

  5. #5
    schulzy175 is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Oct 2017
    Posts
    98
    I figured it out. My function name was the same as my Macro name so there was a conflict. I appreciate you and anyone else who took the time to help. I am marking this thread as solved.

  6. #6
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    hmm, ida never thought of that.
    You should be able to have both, neither are called the same way.
    Ok, now I have a #4.

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

Similar Threads

  1. Microsoft access can't find the wizard
    By PENNAIAH in forum Access
    Replies: 1
    Last Post: 11-14-2016, 07:53 AM
  2. Microsoft access can't find the filed expression
    By Charles CL in forum Macros
    Replies: 1
    Last Post: 12-30-2015, 11:00 AM
  3. Replies: 4
    Last Post: 06-25-2014, 01:44 PM
  4. Replies: 2
    Last Post: 09-07-2012, 03:57 PM
  5. Replies: 6
    Last Post: 10-30-2010, 08: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