Results 1 to 3 of 3
  1. #1
    Join Date
    May 2014
    Posts
    98

    Unanswered: Export access data to create excel charts

    I am using this code it is giving me error 3828 at the line marked red. Says cannot reference a table with multi-valued field using an IN clause that refers to another database. Query has fields which gets input from combo box but only one value is saved in it.
    Code:
    Dim xl As Object ''Excel.Application
    Dim wb As Object ''Excel.Workbook
    Dim ws As Object ''Excel.Worksheet
    Dim ch As Object ''Excel.Chart
    Dim myRange As Object
    
    Set xl = CreateObject("Excel.Application")
    
    sExcelWB = "C:\Users\book2.xls"
    
    'This will overwrite any previous run of this query to this workbook
    DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "AQuery", _
          sExcelWB, True
    Set wb = xl.Workbooks.Open(sExcelWB)
    
    ''Sheets are named with the Access query name
    Set ws = wb.Sheets("Sheet1")
    Set ch = xl.Charts.Add
    ch.ChartType = xlColumnClustered
    
    xl.Visible = True
    xl.UserControl = True
    ''Still not saved
    End Sub

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    ooh this is a fun game, lets diagnose what the problem with a query is, but to make it interesting:-
    Im not going to tell you what the query actually is...

    a game that is too rich for me to waste my time on to be honest
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    May 2014
    Posts
    98
    Why not what's the problem
    Quote Originally Posted by healdem View Post
    ooh this is a fun game, lets diagnose what the problem with a query is, but to make it interesting:-
    Im not going to tell you what the query actually is...

    a game that is too rich for me to waste my time on to be honest

Posting Permissions

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