supressing "item not found" error

  • Thread starter Thread starter Mark Kubicki
  • Start date Start date
M

Mark Kubicki

I'm using the following code to display a report (where the contents of the
IN() statement are built by code not shown here...)
essentially it works; with one exception:

It is possible that an item included (in the IN()), may not have any related
records to display in the report; this returns the error "item not found".

How can I suppress the error? Alternately, I could write code that would
check for the existence of the item in the collection as the IN() statement
is being built...
Any thoughts, suggestions?

DoCmd.OpenReport stDocName, acPreview, , [Type] IN("TA", "TB", "TE",
TF"...)

thanks in advance,
Mark
 
This code
DoCmd.OpenReport stDocName, acPreview, , [Type] IN("TA", "TB", "TE",
TF"...)
would never work. Have you stepped through the code to see where the error
actually occurs?

The where condition basically gets applied to the Filter property of the
report and shouldn't generate an error based on the list inside the ()s
unless no records are returned in the report.
 
Back
Top