If you have a form open it in design view. Look at the even properties. Click on the On load event. You should be given a choice of three things one of which is code builder. Try a simple bit of code, e.g.
msgbox "Hi there"
Once you've got some code it's easy to scroll up the top of the code page where you should see soemthing like
Option compare database
Here you can produce your function, e.g.
Private Function todaysDate()
Side note: User defined functions can be accesses in the query builder. You first have to create and save the module with funcitons in it. once you have done that you can browse for them in the query builder.