I want to build a global function with the aim not to proceed further if the user had not
chosen a selection fron the Option Box Office.
The function is the following :
Public Function MyFilter()
If IsNull(Forms![FBenchmark]!Office) Then
DoCmd.Beep
MsgBox ” Please select Office first ! ”
Exit Function
End If
End Function
If there is no selection, then the message appears indeed
but after that i receive different kinds of errors since after my global function i have different commands
as opening a ofrm, report and so on.I could avoid that error by placing the further commands in the Else
condition.But i do not want that, i want to build a fully independent function MyFilter to be used in a lot of cases and this function must not be influenced by the further commands in the OnClick events of the form. For example, i want to write the following:
Call MyFilter
DoCmd OpenForm ” Classes”
etc
etc
Is that possible ?
.