VBA calling an access query to fill Excel File -
run-time error '3190' many fields defined
i recieve error when click on button calls queries in docmd.transferspreadsheet:
'------------------------------------------------------------ ' creates excel file in path passed ' returns path of file including file name , extension '------------------------------------------------------------ function createexcelfile(path string) string dim outputfilename string outputfilename = path & "summarytemplate.xlsx" dim queries(1 4) string queries(1) = "qryprocessauditscores" 'audit scores queries(2) = "qryprocessauditstations" 'audit stations queries(3) = "qryprocessncs" 'number of nc's queries(4) = "qryprocessauditcount" 'number of audits year dim qry each qry in queries docmd.transferspreadsheet _ acexport, _ acspreadsheettypeexcel12, _ qry, _ outputfilename, _ true next createexcelfile = outputfilename 'return total path end function
when run queries hand in access recieve no such error. have tried compact , repair database no luck. other ideas?
thanks
i ended running sql commands set queries tables, ran transferspreadsheet tables, , ran sql commands drop tables.
vba access-vba ms-access-2010
No comments:
Post a Comment