Bring Latest Code To Top

Bring Latest Code to the Top

Often, you will want to add some Custom Functionality to your MS Access Form by creating a Command Button. Once you have created the Command Button you will more than likely add some code to the onClick event of the command button.

You would do this by opening the property sheet and finding the Button “on click event”, press on the ellipsis and this will automatically generate a code stub in the Code Module behind the Form, ready for your custom code. If your Code Module already has lots of code in it, then the button onClick event could be created anywhere in the code list.

Luckily the cursor will be flashing at the code stub and give you an indication of where You need to enter your custom code. However because of the seemingly random placement of the Code Stub by MS Access, you may have difficulty finding the stub subsequently.

A good practice to get into is to copy the Code Stub to the top of your form, place it under the declarations and properties (if you have them). Now you will be able to find it easily when you come back to this Form…

Bring Latest Code to the Top

Bring Latest Code to the Top

Video 1 (09:26)

In this video I demonstrate a a very simple but very useful technique. All you do is bring the latest code you are working on in a form or a module to the top, just below the declarations. Now when you return to your project a few days, weeks or month’s later, you automatically know the last piece of code you were working on… Sort of like my favourite subject “Self Documenting Code”

Video 1 (09:26)

Nifty Access YouTube Thumb Nail
Play Video

… …

More Useful Stuff HERE:-

Leave a comment

This website uses third-party software - WordPress Add-Ins to be exact. I don't know what any individual add-in does, but I'm sure that many of them collect information about you. So be aware, if you continue using this site, then you are likely to be sharing your information. I don't know how to disable this sharing for any, or all of the plugins for individual users. So I can't stop the sharing of information. If this worries you then please do not use this site... If you continue to use this site I will assume that you are happy with it.

Do you need a hand in the right direction?

You are in the right place.