I need to stop the execution of any codes or function whenever i use my global function DisregardCity.
My task is the following.Sometimes the user must not use the option box DisregardCity and use the other 2 options.
Therefore if the user uses the option group DisregardCity, he must receive the message “Please disregard the city” and
must be returned to the initial position, preventing the execution of the codes. But i cannot stop the other codes from executing.
I will give an exampple. I have the following picture.The user chooses from the option group City, then goes to the second option group
to select a counry and then to another option group to select the month and opens a report.Then the message appears “Please disregard
the size” and after entering the OK, the report is being opened.I do not want to open the report in this case, i want that the function
DisregardCity stops any further code, clears any functions and retruns to the initial position.
I have tried with DoCmd.Cancedl event, alos with closing and opening the form again, and also with Exit Function, but the report continues to be opened even though i have placed the function DisregardCity”
May i receive some help in my problem”
Here is my function:
Private Function DisregardCity()
If Me![OptCity] 0 Then
MsgBox “Please disregard size !!”
End If
End Function