Label OnClick Event is calling Function Twice (1 Viewer)

modest

Registered User.
Local time
Today, 17:35
Joined
Jan 4, 2005
Messages
1,220
I'm making my own custom calendar and i have 42 labels (each holds a day). Eventhough there are a max of 31 days in a month, sometimes days start off on a Wednesday or a Saturday, so there are 6 rows of 7 labels for placeholders (see the attachment).


In each label's onclick i have "=DayClick(1)" without the quotes. The 1 is the label number so it ranges from 1 to 42 depending on the label.


I've stepped through the code and there are no recursive calls or anything of the matter. The funny thing is that when I actually use the OnClick event handler and call the function from within there, it works.


Does anyone know why this is being called twice?
 

Attachments

  • Untitled-1.jpg
    Untitled-1.jpg
    70.7 KB · Views: 174

modest

Registered User.
Local time
Today, 17:35
Joined
Jan 4, 2005
Messages
1,220
Found my error, as usual :( Originally, I made it a Public Sub(), but when I changed it to a Public Function() it worked correctly.

Stupid mistakes.
 

Users who are viewing this thread

Top Bottom