Results 1 to 7 of 7
  1. #1
    Marianna_Air is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2012
    Posts
    56

    Report VBA Issue

    Hello,
    I'm a bit new so be patient with me. I’m trying to use a database (Access 2003 32bit) that my company has to track purchase orders and restructure it to track request for quotes (Access 2010 64bit). All has gone smoothly until I started working on the reports, when I try to open a report with the open report button on my form I get an error that says “Compile error: Sub or Function not Defined” below is the code I’m trying to run. Please note this works just fine in the original access 2003 database

    I also have not changed any of the database object names, I'm holding off on this until I know for sure that I've imported all of the objects I need from the original database

    Private Sub Report_Open(Cancel As Integer)
    intLineNum = 0


    If Not IsLoaded("Purchase Orders(inventory)") Then
    MsgBox "Open this report using the Preview button on the Purchase Orders form."
    Cancel = True
    Exit Sub
    End If
    End Sub


    Thanks in advance for any help I can get on this
    Kevin

  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,641
    IsLoaded is not a built-in function, it's a property (check in help for its syntax). If you haven't created a public function with that name, as many people do, you can't use it like that.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Marianna_Air is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2012
    Posts
    56
    Hi,
    Thanks for the response, I'm new at this so I'm still lost. This code works on the original database so is there something I need to import from it into my new one to make this work? How would I see if there is a public function for it?

    Thanks

  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,641
    Open the VBA editor in the original database (ALT-F11). Hit CRTL-F to search. Type in IsLoaded and search Current Project. You should find the function that would start with:

    Public Function IsLoaded

    Copy the entire function into a standard module in the new db.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Marianna_Air is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2012
    Posts
    56
    Got it, found the module for "isloaded"

    Thanks a million

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    No problem, and welcome to the site by the way!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    Marianna_Air is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2012
    Posts
    56
    I've been out of the database building game for about 11 years now but it's comming back to me slow but sure

    Thanks again

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

Similar Threads

  1. report Criteria issue
    By manic in forum Reports
    Replies: 2
    Last Post: 02-15-2012, 10:02 PM
  2. Report Sorting Issue
    By cbgroves in forum Reports
    Replies: 14
    Last Post: 12-01-2011, 08:44 AM
  3. Report grouping issue
    By GraemeG in forum Reports
    Replies: 0
    Last Post: 06-16-2011, 10:50 AM
  4. Rental db report issue
    By InThrees in forum Reports
    Replies: 0
    Last Post: 12-03-2010, 02:47 PM
  5. Interesting Issue With Report
    By dynamictiger in forum Reports
    Replies: 1
    Last Post: 04-15-2010, 05:40 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