Is there a way that I can turn this into a module or a function.....or
something so that I can call it. As opposed to writing this code over and
over again.
Thanks
DS
A Module (using the Modules tab on the database window) is a container for
multiple Subs and Functions. You can copy the VBA text of a function into a
Module; be sure its first row is something like
Public Function <some function name...>
and you'll be able to reference it from anywhere in the database.
Just be sure to give the Module a DIFFERENT name than the name of the
function. That is, if you have Public Function MyStuff(this, that, theother)
then don't save the module as MyStuff; Access will get confused. Use something
like basMyStuff or Utilities as the name of the module instead.