Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2004

    Unanswered: Export Current Record

    How can I export just the current record via a command button on a form? I have it set up to export, but it exports every record, not just the current.

  2. #2
    Join Date
    Mar 2004
    Create a query based on the data you want to export. In the criteria of the ID field put..


    changing "frmYourForm" to the name of the form in question and "ID" to the control on the form that holds the ID.
    In the OnClick event of your button put the following code (if you are importing to Excel)

    DoCmd.TransferDatabase acExport, acSpreadsheetTypeExcel9, "YourQuery", "C:\YourSpreadsheet.xls", True

    Download for FREE the ADO/DAO Data Controls that makes life EASIER developing database applications in: VB, FoxPro, Access, VC++, .NET etc... Navigate, Add New, Delete, Update, Search, Undo and Save your changes. Supports Disconnected Recordsets and Transactions!

    Or try our Ask An Expert service to answer any of your questions!

Posting Permissions

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