Thank you...Since some of that is greek to me...Does that mean, since I have changed Public Function OpenCal() to Public Sub OpenCal() I have to:
- delete the OnClick command of the command_OpenTheCalendarForm that is currently =OpenCal()
- Create an [event procedure] for the command_OpenTheCalendarForm that reads Call OpenCal()
?
Functions can be evaluated by the expression service, so they can be called directly from an event property, as in your example, where you had the OnClick property of a command button set to:
=OpenCal()
That doesn't work with a Sub. I find that quite convenient, so if I have a procedure that I want to be able to call from mutiple control events, I will often make it a Function even if it doesn't need to return a value. There is no harm in that. Because it's a function, technically it returns a Variant value of Null or Empty (I don't recall which) if you don't assign any return value, but you can always ignore the return value of a function anyway.