Results 1 to 5 of 5
  1. #1
    wasim_sono is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    May 2005
    Location
    Pakistan
    Posts
    73

    Out put file


    Dear All

    I need to generate an excell file as user click a label. I used the following code but got a compile error. the code is given below

    Private Sub Label61_Click()
    DoCmd.OutputTo Table, IncTransaction, ExcelWorkbook(*.xlsx), d:/fuel&incentive/Inc.xlsx, Yes, , 0, print
    'DoCmd.Quit
    End Sub

    This is working in macro but in VBA it gives error.
    Need help

    Thanks.

    Wasim

  2. #2
    SoftwareMatters is offline Access VBA Developers
    Windows XP Access 2003
    Join Date
    Mar 2009
    Location
    Dorset
    Posts
    274
    What is the error?

    What are you trying to output to Excel?

  3. #3
    wasim_sono is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    May 2005
    Location
    Pakistan
    Posts
    73
    I got a compile error. I can show you the error but here is no option to attach a file. If you give me an email address then I can send you a copy.

    Thanks.

  4. #4
    wasim_sono is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    May 2005
    Location
    Pakistan
    Posts
    73
    I got a compile error. The screen shot is attached for reference.


    Thanks.

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    You either need to click on Post Reply or Go Advanced to get the option to attach a file. At a guess, I'd say to look at VBA help at OutputTo. Off the top of my head, I don't recall Table being a valid argument, and arguments such as the table name and path have to be strings (enclosed in quotes), like "IncTransaction".
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 03-02-2010, 12:02 PM
  2. Upload file inside .mdb database file
    By havish in forum Access
    Replies: 0
    Last Post: 07-30-2008, 07:35 AM
  3. Possible to export *.mdb file to *.exe file?
    By slpuiwan in forum Import/Export Data
    Replies: 1
    Last Post: 12-16-2007, 06:52 PM
  4. How do you export a file with a unique file name
    By Budman42 in forum Import/Export Data
    Replies: 1
    Last Post: 10-15-2006, 06:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums