Error from No Value on Report, Need to Ignore or Circumvent

Heatshiver

Registered User.
Local time
Today, 15:22
Joined
Dec 23, 2011
Messages
263
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.
 
UNtested.
But it sounds that you need to open the form first and select the Start and End dates you are interested in.
Then, offer the choice of Reports.
With the selected report, create an OPenArgs statement based on the Dates selected
then Open the report with OpenArgs.

This of course means that all of your reports will have some Start and End Date.
 
Last edited:
@jdraw thanks for the reply. Someone had mentioned opening the date form first, but not the OpenArgs.

How would I get the value in the OpenArgs to pass to my report?

I'm assuming it will look something like this to start with:

DoCmd.OpenForm "frmName", , , , , , "OpenArgs"
 
I ended up going a different route that didn't involve OpenArgs, and that worked.

Thanks for the help!
 
I ended up going a different route that didn't involve OpenArgs, and that worked.

Thanks for the help!

Perhaps you could describe "the different route" since others, with similar issue, would see your solution.

Yes the approach suggested would have been similar to your OpenForm example, but would have been OpenReport....
 
The route was awkward. There are many interface forms. I merely changed the order so that the date form was first, then hidden, then the reports are chosen.

Thanks for all the help!
 

Users who are viewing this thread

Back
Top Bottom