Why Does My Button Code Copy To "General" Object Window From "[My Button Name]" Objec

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • soule
    New Member
    • Jan 2012
    • 34

    Why Does My Button Code Copy To "General" Object Window From "[My Button Name]" Objec

    In order to use the "Me" reference in Access VBE and to have simpler, cleaner code, I moved some automation button code (Private Sub A1_Form_Re_send _Welcome_E_Mail _Only_Button_Cl ick()) from a standard module into its object in my main form class module. I saved it. I then removed the old standard module. When I re-entered the VBE, I noticed that my code was now on both the "(General)" object window and the "A1_Form_Re_sen d_Welcome_E_Mai l_Only_Button" object window. When I deleted it from the "(General)" object window, it also deleted it from my button object window! I retrieved it, but...

    Does the "(General)" object window show ALL the code in the form class module?

    Why was it put in the "(General)" object window in the first place?

    Does deleteing code in the "(General)" object window delete the code in the "[My Button Name]" object window?

    Thanks for the enlightenment -

    Frank
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    I'd suggest you ask this in the Access / VBA forum where you're likely to find more expertise with VBA.

    If the interface is very much like the VB6 editor then you can switch between Procedure View, which shows just the procedure you're looking at (such as Button1_Click) and Full Module View, which shows all of the code in the module. In the latter case, you might get the impression that you're seeing the code in more than one place, because selecting a particular procedure just moves the text cursor there, without changing what's shown.

    Comment

    • soule
      New Member
      • Jan 2012
      • 34

      #3
      Thanks, K-42,

      I get it. I think I may have also had my cursor in the general declatrations (option explicit, etc.) and actual code sections at different times.

      S.

      Comment

      Working...