Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2004
    Posts
    173

    Unanswered: Forms Recordset Print and Export

    I need to take the current recordset from a form and allow the user to print those records in a datasheet view. However I don't want to allow the user to use the datasheet view of the form. I would also like to allow the user to take the recordset out to excel without allowing them access to the output to excel button. What I've done so far is created a query with the necessary fields from the form and added any filter criteria to trim the set of records to whatever they've got on the screen -- this worked well, but now how can I get that query object to print its contents and how can I get the query object out to excel. I tried the OutPutTo command and that works reasonably well except for the fact that it takes you to a file dialog box first. I would like to make it as seemless as possible. Has anyone done this before and/or am I going about this all bass ackwards? Any replies would be great thanks.

  2. #2
    Join Date
    Apr 2004
    Location
    metro Detroit
    Posts
    634
    For the xls export look at SendObject.

    For the print out you may want to consider a report set up to look like a datasheet view of the form.

  3. #3
    Join Date
    Apr 2004
    Posts
    173
    Unfortunately I'm not looking to send the information via email to anyone. I want to open an excel spreadsheet on the local machine with the records currently being displayed by the form as set by a possible filter. So I'm not sure how the sendobject would help that situation. If i missed something let me know.

  4. #4
    Join Date
    Apr 2004
    Location
    metro Detroit
    Posts
    634
    Sorry,

    Use DoCmd.TransferSpreadsheet

  5. #5
    Join Date
    Apr 2004
    Posts
    173
    How can I immediately open that spreadsheet once the info has gone to it?

  6. #6
    Join Date
    Apr 2004
    Location
    metro Detroit
    Posts
    634

Posting Permissions

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