Macro invoked by mystery object.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Annalyzer
    New Member
    • Aug 2007
    • 122

    Macro invoked by mystery object.

    I have a form (Single Form view - bound to tblVisit) that when opened, give me the error message "Microsoft Access can't find macro 'providerMenu'. "

    Problem is, there are no Event handlers set on the form (according to the Properties dialog box), although there may have been at one time that have since been deleted. I've also looked at every control on the form and there are no Event handlers set anywhere. Is there any way to find out what is invoking this macro or is this a job for Rod Serling? It's a Twilight Zone joke for those of you who are too young (ouch) to remember.

    I'm using Access 2003.
  • nico5038
    Recognized Expert Specialist
    • Nov 2006
    • 3080

    #2
    Can be a sign of corruption, create a new empty database and use "File/Get external data/Import" to get a "fresh" copy of all your objects.

    Nic;o)

    Comment

    • Annalyzer
      New Member
      • Aug 2007
      • 122

      #3
      My first reaction to your answer was "Oh, goody" with a fair amount of sarcasm thrown in, but if it will fix the problem I'll give it a shot. This is a fairly large database, so I guess I know what I'll be doing this weekend.

      Thanks nico5038, I really appreciate your help.

      Today's mantra: make-backups-more-often make-backups-more-often make-backups-more-often...

      Comment

      • nico5038
        Recognized Expert Specialist
        • Nov 2006
        • 3080

        #4
        It's not really much work, as the "File/Get external data/Import" shows a pop-up form allowing you to select all objects per type (Table/Query/etc.).

        It's in general my first action when a database acts strange. A "decompile" is "heavier", but will fix even more. (http://www.granite.ab.ca/access/decompile.htm.

        Success !

        Nic;o)

        Comment

        • Annalyzer
          New Member
          • Aug 2007
          • 122

          #5
          Thanks! You're right, it doesn't look like it's going to be too bad. I can't get to the article you linked right now - getting a 404 error - probably a DNS issue, but I've been stuck on this macro problem for so long and I'm so happy to have a postive direction to take that I'm not inclined to stop and muck with networking issues right now.

          I'll take a look at it later (or sooner if, for some reason, this solution doesn't work). Have a great day! or night! or whatever time zone you're in. lol

          Comment

          • Annalyzer
            New Member
            • Aug 2007
            • 122

            #6
            Well, I imported everything into a new database and it seems I apparently imported the problem as well. Still getting the same error message. Looks like I'll be messing with dns today, but I'm giving it some time first in case it's my ISP and not me.

            Thanks for your help and I'll let you know if I figure it out.

            Comment

            • nico5038
              Recognized Expert Specialist
              • Nov 2006
              • 3080

              #7
              Looks like the site is down, but google has the page in it's cache:


              I'm in the Dutch GMT+1 time zone, so it's evening :-)

              Nic;o)

              Comment

              • Annalyzer
                New Member
                • Aug 2007
                • 122

                #8
                Mystery solved! I found the option in help for displaying object dependencies, so I displayed the dependencies for frmVisit (the form with the problem). It showed me that it was dependent on tblProvider. Object dependencies for tblProvider showed that it was missing an object named "School" or "School and Income." Well, I knew I did't have an object by that name, but that I did have a field in tblProvider that had those two items as lookup values. Sure enough, the Row Source Type for that lookup had gotten changed to "Table/Query" instead of "Value List." I changed it back to "Value List" and the problem was solved.

                I don't know how that Row Source Type got changed....some times I think my mouse just clicks on things randomly when I'm not looking. ;-)

                Comment

                • missinglinq
                  Recognized Expert Specialist
                  • Nov 2006
                  • 3533

                  #9
                  And where did providerMenu fit into all of this?

                  For future reference, when Access says that it can't find a Macro named Whatever, Whatever isn't necessarily a Macro!

                  Usually, when Access encounters the name of an object and can't locate that object, it pops an error message such as you got, naming the missing object and correctly identifying the type of object. Access does this by using context. In the line

                  DoCmd.OpenForm "Whatever"

                  for instance, if Whatever can't be found Access will say "Access can't find the Form Whatever." Access correctly identifies Whatever as a form, in this case, because of where it appears in the code.

                  But if Access runs into a line of code with a name standing all alone

                  Whatever

                  (which can happen, for instance, if the developer goes to delete some code and accidentally leaves the name behind) it has no context to correctly identify the type of object that is missing. And when this happens, Access always assumes (for some obscur reason that only Billy Bob Gates understands) that the missing object is a Macro! It would make too much sense, I guess, to simply say "Access can't find the Object Whatever."

                  Glad you finally got it figured out!

                  Welcome to Bytes!

                  Linq ;0)>

                  Comment

                  • Annalyzer
                    New Member
                    • Aug 2007
                    • 122

                    #10
                    Thanks, linq! I can't remember what providerMenu was, but I'd be surprised if it was an object. I try to always name my objects beginning with the type of object - tblProvider, qryProviderRegi stration, mcrRunWhatever, etc.

                    It may very well have been a variable somewhere in my code, however. I recently deleted a LOT of code after figuring out how to pass enough parameters to do the job with one public function instead in a module instead of a whole bunch of private functions in individual objects.

                    I went back to a prior version of the database to look for providerMenu, but after about 10 minutes found that my curiosity wasn't all that strong after all. I'm so excited to be back on track, I'm moving forward now. And you know what they say about objects (or developers) in motion....

                    Comment

                    • NeoPa
                      Recognized Expert Moderator MVP
                      • Oct 2006
                      • 32663

                      #11
                      It sounds like your solution was better than mine anyway, but as a general point, I will just say that the Documenter (Tools / Analyse / Documenter in Access 2000 - a single "N" in this case ;)) can often help find confusing links.

                      It gives options to include a great deal of the layout of a database in the results, which can be saved as an RTF file. This file can be opened in Word and searched thoroughly.

                      It's a bit cumbersome, but can answer a lot of questions when used properly.

                      PS. I just check a PC we have with Access 2003 on and it works the same on there too :)

                      Comment

                      • Annalyzer
                        New Member
                        • Aug 2007
                        • 122

                        #12
                        Thanks, NeoPa. I used Documentor when I took Access in college a couple of years ago (our instructor had us turn in assignments that way as well as electronically) , but I hadn't thought to use it for "real" purposes. I'll try that next time. =)

                        Comment

                        • NeoPa
                          Recognized Expert Moderator MVP
                          • Oct 2006
                          • 32663

                          #13
                          ; - )

                          Comment

                          Working...