Organizing my code

Paulsburbon

Registered User.
Local time
Today, 01:25
Joined
May 3, 2005
Messages
65
Hello,

I've used a bit of visual studio 2005 and on a form you can organize code by using #region and #end region I beileve. Can you do anything like that in access 2007??

Thanks

Paul
 
No. What I do though is group like procedures, Command Button Clicks, Form Event Handlers etc... into distinct sections of a module and then offset these blocks of code with a box like...
Code:
Sub AA_SectionHeader()
   Dim i As Integer
   SendKeys _
"'******************************************************************** " & Chr(13) & _
"'*                                                                                                   " & Format(Date, "mmm d yyyy") & Chr(13) & _
"'*       >" & Chr(13) & _
"'*" & Chr(13) & _
"'********************************************************************" & Chr(13)
   For i = 1 To 3
      SendKeys "{UP}"
   Next i
   For i = 1 To 9
      SendKeys "{Right}"
   Next i
End Sub
Put this code in a standard module and run it in any code window using <Alt>, <t>, <m>, <Enter>, which is Menu->Tools->Macro->AA_SectionHeader->Run.
 
there are also a couple of small buttons at the bottom of the code window that let you view all procedures in the current module or only the current procedure. not much grouping there but in case u didn't know...
 
Also, you can jump to any block using two comboboxes at top of VBE code window.
 

Users who are viewing this thread

Back
Top Bottom