MS Access/VBA Tips:
I remember when I first started coding. We would type out the code in a text-type editor, then cross our fingers during compilation - hoping nothing would go wrong! Luckily - MS Access gives code writers hints and selection options. Once in the module section - underneath the Option Compare Database header, you could try out a few of my favorites:
Type in: docmd.
You need to actually type in the period after docmd and wait a few seconds at most. Some selection options will appear and you can use the down arrow to preview them. These are options that are also available in the Macro section of the database.
In order to declare a variable - you use the word DIM and specify the name and variable type. For example - type in:
DIM MyDate as
Give Access a second or two to bring up the dropdown list and select date from the list provided.
Documentation of code is so important. To put comments in the code so you can remember what you've done and why you did it, just put an apostrophe at the beginning of each line of comment. Once you press enter, Access will turn the code a different color - normally green.
Learn more about this author, Linda J Banks.
Click here to send this author comments or questions.
Below are the top articles rated and ranked by Helium members on:
by Gail Wynand
In general a top down approach should be followed especially when creating a function.
Start with a module, if need be create
MS Access/VBA Tips:
I remember when I first started coding. We would type out the code in a text-type editor, then cross
Add your voice
Know something about How to create a custom function in Microsoft Access?
We want to hear your view.
Write now!
Cast your vote!
Click for your side.
Featured Partner
Per Scholas is a non-profit organization dedicated to using technology to improve the lives of people in low-income c...more
hide