
I am new to VBA for Access. I want to have one set of functions for all the buttons on my forms.
For example, I have a button to go to the next record (btnNext) on many forms.
I do not want the same code in every form for the OnClick event of these buttons.
I want to call a function (that store in a module as a Public Function. See function below):
HOW and WHERE do I call this function? Why can't I just put "btnGoToNextRecord()" in the OnClick event box? Do I need to make it an [Event Procedure] and call it? If so, what is the syntax?
THANK YOU!

Public Function btnGoToNextRecord()
On Error GoTo Err_btnGoToNextRecord
DoCmd.GoToRecord , , acNext
Exit_btnGoToNextRecord:
Exit Function
Err_btnGoToNextRecord:
MsgBox Err.Description
Resume Exit_btnGoToNextRecord
End Function