I have an intricate bunch of switchboards that opens different forms and reports.
When I get to reports, you first click a button to open reports instead of forms, then the report of your choice, then a form that has a start and end date, then finally the report selected.
Everything was working perfect until I added the start date as part of the report's query criteria (which it gets from the form with the start and end date).
The issue is that the report is actually opened and hidden before it is shown. When the report loads there are certain fields, that if blank, are grayed out. However, because it now wants a date from the form with a start and end date, it gives an error since that form has yet to come up.
*I need a way to either ignore the error and press forward, or a different way to tell is to stay hidden but ignore the VBA for the load event until the button on the date form has been clicked.
Here is my code in the load event:
If Len(Me.Textbox & "") = 0 Then
Me.Textbox.BackColor = vbBlack
End If
I've tried "On Error Resume Next", but maybe I'm not putting it in the right place. I tried above and/or below, and even after the first line of the If statement with no success. If anyone has an idea as to how to get around this, please help!
Thanks.