Open report only after checking that it exists?

G

Guest

I am doing something similar to neeraj in the question of 8/3/2005. I am
using a form to list possible reports to print. My question is, how can I
check to see if a report exists prior to opening it? I figured out how to
deal with an error if they didn't select a report, but am not sure how to
proceed if they select a report and it doesn't exist. This is in case the
report name is misspelled in the report listing or someone deleted the report
manually (we may be changing what reports exist in the future). I am
including neeraj's message only for reference. Thanks for your help.

neeraj's message of 8/3/2005

I have a macro written into the 'On Click' event of an OK button of a form.
This macro has got just one command row:Open Report. For the 'Report Name'
field, I am trying to pass the report name from the value selected from a
list box in that form. The Report Name field says:
[Forms]![myForm]![lstReports]
where [lstReports] is the name of that list box
When I hit the OK buton, it doesn't open the report and gives an error
message saying that
"The report name [Forms]![myForm]![lstReports] that you entered in either
the property sheet or the macro is either mispelled or doesn't exist"
How can I make this work?
 
G

Guest

I found an error trapping procedure one the web that displays the error
message and am using that rather than trying to avoid the error altogether.
Thank you for your help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top