SteveL13
asked on
What is wrong with this form?
Earlier this week an expert helped me with a checkbox issue. But I have turned the Main Form into a form with 7 sub-forms. I cannot figure out why when I enter, for example, a Start Time and End Time in the Sunday subform, I get "Invalid use of null" and the times go blank. And yet if I close and re-open the form it seems to look ok. Can someone tell me what is wrong?
Sample file attached.Test.accdb
Sample file attached.Test.accdb
ASKER
I changed all of the sub-forms to Cycle = Current Record and the issue went away. Also, I need to be able to see the entire week, hence 7 sub-forms.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
While having error handling in place for the final product, I cannot recommend this style of error handlers during development. It clutters the code and makes it hard to read. And it hides the error and disables the debug feature of the VBA IDE.
Refactor your application. There is no need for separate forms. You only need one single sub form and reuse it for each day.
Always use Dim As Long, never Dim As Integer as long as you don't have explicit reqreuiments. Integer (-32k to +32k) can and will overflow in the one or other use-case.