Table with No Data

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Home

    Table with No Data

    I am using the following code to export a table into an Microsoft Excel
    Speadsheet.

    Dim strSql1 As String
    DoCmd.SetWarnin gs False
    DoCmd.OpenQuery "qDeleteNewslet terLabels"
    DoCmd.OpenQuery "qStudentsNewsl etterLabelList"
    DoCmd.OpenQuery "qVolunteerNews letterLabels"
    DoCmd.OutputTo acOutputTable, "tblNewsletterl abels", acFormatXLS,
    "Newsletterlabe ls.xls", True
    DoCmd.RunSQL strSql1
    DoCmd.SetWarnin gs True

    Is there a way to confirm that there is data in the table before the empty
    spreadsheet is generated?

    Glen



  • Jim Allensworth

    #2
    Re: Table with No Data

    On Wed, 26 Nov 2003 17:51:23 GMT, "Home" <don'tsendt@e-mail.com>
    wrote:
    [color=blue]
    >I am using the following code to export a table into an Microsoft Excel
    >Speadsheet.
    >
    > Dim strSql1 As String
    > DoCmd.SetWarnin gs False
    > DoCmd.OpenQuery "qDeleteNewslet terLabels"
    > DoCmd.OpenQuery "qStudentsNewsl etterLabelList"
    > DoCmd.OpenQuery "qVolunteerNews letterLabels"
    > DoCmd.OutputTo acOutputTable, "tblNewsletterl abels", acFormatXLS,
    >"Newsletterlab els.xls", True
    > DoCmd.RunSQL strSql1
    > DoCmd.SetWarnin gs True
    >
    >Is there a way to confirm that there is data in the table before the empty
    >spreadsheet is generated?
    >
    >Glen
    >[/color]

    If it is empty this will return zero.
    DCount("*","tbl Newsletterlabel s")

    - Jim

    Comment

    Working...