Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    Jan 2001
    Posts
    159
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Emailing a Form (Access 97)

    I have a form that I use to look up a certain record (I'm using a combo box to choose record) and I want to send the resulting record via email. I have written a macro and use SendObject - object type is form, object name is frmAddAdvertising, output form is Excel, I have entered two addresses in the To: field. When I send the email message the Excel document has the row headers in Row 1 but no data in Row 2.

    Any suggestions on what I need to add to the code?

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Emailing a Form (Access 97)

    Hi Sherri
    If you send a form, you will send all records defined by the RecordSource of that form, I don't think that's what you want, is it?
    I could be wrong, but what you will probably have to do is to generate a query that selects just the one record and use that in the SendObject statement.
    Pat <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  3. #3
    2 Star Lounger
    Join Date
    Jan 2001
    Posts
    159
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Emailing a Form (Access 97)

    Would i be able to create this query and use a command button to run it. I'm assuming that the command button would run a macro that runs the query and then sends the object. But, what criteria would I use in the query to only show active record.

  4. #4
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Emailing a Form (Access 97)

    Sherri,

    I have done something similar to your request but using a report. Check out <post#=211930>post 211930</post#> for some ideas.
    Regards,

    Gary
    (It's been a while!)

  5. #5
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Emailing a Form (Access 97)

    Sherri
    What control on the form could be used to apply as the criteria to select the current record that the form is showing?

    What you need is a query that is basically the same as the query behind the form with a criteria on the control chosen from the form.
    It seems like you have your SendObject statement worked out, all you need to do is to reference the query instead of the form.

    You don't need to run the query, it is executed by the SendObject statement.

    Post back if this is not clear enough, or maybe post a zipped version of your DB.
    Pat <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  6. #6
    New Lounger
    Join Date
    Feb 2003
    Location
    New Orleans, Louisiana, USA
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Emailing a Form (Access 97)

    <P ID="edit" class=small>(Edited by charlotte on 13-Feb-03 20:13. to activate link.)</P>Sherri, the best way to accomplish your objective is to use a Query by Form. You can find information on how to do this at
    http://support.microsoft.com/default.aspx?...=kb;EN-US;95931

    I have use this technique in many Access applications that I developed and works great.
    Lu

Posting Permissions

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