![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello Access 2003. I am trying to program a macro to close a report automatically. When the report has records this is not a problem. When the report does not have records a MS Office Access message comes up reading "The report named 'sales' you entered is misspelled or refers to a report that is not open or doesn't exist." Does anybody have any recommendations? Thanks Tony |
#3
| |||
| |||
|
|
The simplest approach is not to Open the Report unless its Record Source Query produces Records. *Use the Report's Query in a DCOUNT domain aggregate statement, something like the following where the Report is called "Arep", its RecordSource is "AQry", and "AFld" is any field that will have a value for each record (like, say, the key field for the records): * * If DCOUNT("AFld","AQry") > 0 Then * * * * DoCmd.OpenReport ("Arep") * * End If *Larry Linson * Microsoft Office Access MVP Tony_E" <bluestealt... (AT) hotmail (DOT) com> wrote in message news:67b01c5b-f705-44ae-8aa8-e1969cccadec (AT) m7g2000vbn (DOT) googlegroups.com... Hello Access 2003. I am trying to program a macro to close a report automatically. *When the report has records this is not a problem. When the report does not have records a MS Office Access message comes up reading "The report named 'sales' you entered is misspelled or refers to a report that is not open or doesn't exist." *Does anybody have any recommendations? Thanks Tony |
![]() |
| Thread Tools | |
| Display Modes | |
| |