In the example below I have chosen to define the input variable in a text box called Text_year. The function is run from a for with a Toggle Button. The text box in the same form. My purpose in to invite user to input a year in the text box to obtain the number of days in that year.
The error message given reads:
Control can't be edited ; it's bound to the expression 'DaysInYear([Text_year])
The function:
Any help will be greatly appreciated.
The error message given reads:
Control can't be edited ; it's bound to the expression 'DaysInYear([Text_year])
The function:
Code:
Public Function DaysInYear (ByVal Year As Integer) As Integer Dim LeapDays As Integer LeapDays =0 If Year Mod 4 = 0 Then LeapDays = 1 DaysInYear = 365 + LeapDays End Function
Comment