Results 1 to 5 of 5
  1. #1
    slimjen is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    727

    export form data to excel

    Hi All; using 2010. I have a form with a subform. There are a great deal of calculated fields on the main form mostly calculated from the subform. Is it possible to export unbound access form data included calculated fields to excel? I never had to do this but have a need for this now. I know I can do the calculations in a query and export this but is there a way to have the users do this?
    Thanks

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,526
    you export a query.
    the query has the form items.

    DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, vQry, vFile, True, vTabName

  3. #3
    slimjen is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    727
    Yes; but I have to create the query first and recreate the calculations correct?

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Is it possible to export unbound access form data included calculated fields to excel?
    Yes, but you have to use automation.
    This involves VBA; Ken Snell has examples of Importing from and Exporting to Excel.
    The site is http://www.accessmvp.com/kdsnell/EXC...ExpCopyFromRst
    There is a section sub titled Write Data From a Recordset into an EXCEL Worksheet using Automation (VBA)
    This section shows how to use VBA to export a recordset; you use the same concept (looping to move cells), but modify the code to loop through the unbound controls on your main form.
    YOU are responsible to ensure all data is written, looping to data in the correct cells.

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,963
    I just tested exporting with the wizard an UNBOUND form with textbox that has expression as ControlSource. That worked. TransferSpreadsheet doesn't work with forms and reports, only tables and queries. So only other option is as described by Steve.

    Can have a button that exports query using TransferSpreadsheet. Users don't have to know it's not really the form that is exported.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 6
    Last Post: 05-28-2015, 08:06 AM
  2. Export to excel form data
    By Moopsz in forum Macros
    Replies: 4
    Last Post: 12-18-2014, 02:03 PM
  3. Replies: 3
    Last Post: 06-18-2013, 01:14 PM
  4. Export Report to Excel without Date() and Time()
    By agent- in forum Import/Export Data
    Replies: 5
    Last Post: 12-21-2011, 08:55 AM
  5. Access date export to excel
    By jituknows in forum Access
    Replies: 1
    Last Post: 02-05-2011, 01:32 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