Results 1 to 4 of 4
  1. #1
    mar_t is offline Advanced Beginner
    Windows XP Access 2002
    Join Date
    Nov 2010
    Posts
    52

    Access Report to Excel format

    My code below works perfectly. I select a client in my combo box and click the command button and it will open the report with all the fields I wanted. Now, I want to export the report to Excel format based on the combo box value but there is now "WhereCondition" in DoCmd.Outputto... Any tips and codes are greatly appreciated.

    Code:
    DoCmd.OpenReport "ClientReport", acViewPreview, , "[Client]= '" & Me.Combo0 & "'"


  2. #2
    kennejd is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    188
    I'm on Access 2007, but I remember there's an easy way to export to Excel from the print preview mode of a report....here's a link that shows you how: http://www.howtogeek.com/howto/micro...l-spreadsheet/

    If you want a more automated method, you could create a separate query that uses your desired criteria....then use your transferspreadsheet code.

  3. #3
    mar_t is offline Advanced Beginner
    Windows XP Access 2002
    Join Date
    Nov 2010
    Posts
    52
    Kennejd,
    Do you have sample mdb file or vba codes perhaps that you could share? Don't know where to place the "WhereCondition".

  4. #4
    kennejd is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    188
    When you start typing your DoCmd.OpenReport method, the syntax of the method will appear (intellisense)...and you should be able to see where to put your 'Where Condition'....should be the 3rd argument.

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

Similar Threads

  1. Excel / access report question.
    By Bcitral in forum Access
    Replies: 3
    Last Post: 06-20-2011, 10:46 AM
  2. Create Report in a Matrix Format Like Excel
    By ortley77 in forum Reports
    Replies: 1
    Last Post: 08-24-2010, 09:56 AM
  3. Replies: 0
    Last Post: 11-17-2009, 02:35 PM
  4. Replies: 2
    Last Post: 09-29-2009, 10:25 AM
  5. Excel number format not working in Access
    By toad848 in forum Access
    Replies: 3
    Last Post: 03-24-2009, 11:06 AM

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