Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003
    Posts
    311

    Unanswered: I would like to execute a update qry then export to xl

    The only code i can figure is to execute my qry.
    The only prob with this is that - I Dont want the querry to open, i just want to export it to an excel file with a name i define and a location i define any help much appreciated !

    M!~

    Private Sub cmdupdexpt_Click()
    On Error GoTo Err_cmdupdexpt_Click

    Dim stDocName As String

    stDocName = "upDateFedxMgmtChks"
    DoCmd.OpenQuery stDocName, acNormal, acEdit

    Exit_cmdupdexpt_Click:
    Exit Sub

    Err_cmdupdexpt_Click:
    MsgBox Err.Description
    Resume Exit_cmdupdexpt_Click

    End Sub

  2. #2
    Join Date
    Oct 2003
    Location
    Tampa
    Posts
    10

    Re: I would like to execute a update qry then export to xl

    Try this:

    Code:
    DoCmd.OutputTo acOutputQuery, queryName, _
                acFormatXLS,"Document Path/Name", True


    Originally posted by mikezcg
    The only code i can figure is to execute my qry.
    The only prob with this is that - I Dont want the querry to open, i just want to export it to an excel file with a name i define and a location i define any help much appreciated !

    M!~

    Private Sub cmdupdexpt_Click()
    On Error GoTo Err_cmdupdexpt_Click

    Dim stDocName As String

    stDocName = "upDateFedxMgmtChks"
    DoCmd.OpenQuery stDocName, acNormal, acEdit

    Exit_cmdupdexpt_Click:
    Exit Sub

    Err_cmdupdexpt_Click:
    MsgBox Err.Description
    Resume Exit_cmdupdexpt_Click

    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •