Using SendObject to send a filtered form

Discussion in 'Microsoft Access VBA Modules' started by Anthony, Oct 16, 2008.

  1. Anthony

    Anthony Guest

    I searched the Discussions but can't find anything that directly addresses my
    issue. This is a fairly complicated issue but I know someone will be able to
    help me.

    I have a form (form_A) that has an embedded subform (sub_form_A). I would
    like to use SendObject to send what is in the subform, not the main form.
    SendObject allows you to send a form, which I am able to do. However, it is
    sending EVERY record in the table that the subform is bound to. I would like
    to only send the filtered data on the form. It is a listing of projects by
    user. One user may have 10 projects, another 5, another 20. The subform
    properly displays all the projects associated with that user, but when I do a
    SendObject with a "acFormatXLS", it creates a spreadsheet with every record
    in the table that sub_form_A is bound to.
    the Main form's (form_A) only control is used to display the user . This
    control is then used to filter the subform. BTW: If I SendObject the Main
    form, it only sends that user's name, though there are about 50 users in the
    table. So, SendObject on the main form works correctly.

    Any help would be appreciated.
     
    Anthony, Oct 16, 2008
    #1
    1. Advertisements

  2. One approach would be to create a report that return the sub-form values and
    e-mail a pdf of it (You can use lebans Report2PDF to generate the PDF file
    see http://www.lebans.com/reporttopdf.htm) .
    --
    Hope this helps,

    Daniel Pineault
    http://www.cardaconsultants.com/
    For Access Tips and Examples: http://www.devhut.net
    Please rate this post using the vote buttons if it was helpful.



    "Anthony" wrote:

    > I searched the Discussions but can't find anything that directly addresses my
    > issue. This is a fairly complicated issue but I know someone will be able to
    > help me.
    >
    > I have a form (form_A) that has an embedded subform (sub_form_A). I would
    > like to use SendObject to send what is in the subform, not the main form.
    > SendObject allows you to send a form, which I am able to do. However, it is
    > sending EVERY record in the table that the subform is bound to. I would like
    > to only send the filtered data on the form. It is a listing of projects by
    > user. One user may have 10 projects, another 5, another 20. The subform
    > properly displays all the projects associated with that user, but when I do a
    > SendObject with a "acFormatXLS", it creates a spreadsheet with every record
    > in the table that sub_form_A is bound to.
    > the Main form's (form_A) only control is used to display the user . This
    > control is then used to filter the subform. BTW: If I SendObject the Main
    > form, it only sends that user's name, though there are about 50 users in the
    > table. So, SendObject on the main form works correctly.
    >
    > Any help would be appreciated.
     
    Daniel Pineault, Oct 16, 2008
    #2
    1. Advertisements

  3. Anthony

    Anthony Guest

    Thanks for your response. I was wanting to send it in XLS format and I read
    in these discussions that Access will not allow a report to be sent in XLS
    format. Also, since I wanted XLS format, I didn't want to bother with
    report formatting.

    "Daniel Pineault" wrote:

    > One approach would be to create a report that return the sub-form values and
    > e-mail a pdf of it (You can use lebans Report2PDF to generate the PDF file
    > see http://www.lebans.com/reporttopdf.htm) .
    > --
    > Hope this helps,
    >
    > Daniel Pineault
    > http://www.cardaconsultants.com/
    > For Access Tips and Examples: http://www.devhut.net
    > Please rate this post using the vote buttons if it was helpful.
    >
    >
    >
    > "Anthony" wrote:
    >
    > > I searched the Discussions but can't find anything that directly addresses my
    > > issue. This is a fairly complicated issue but I know someone will be able to
    > > help me.
    > >
    > > I have a form (form_A) that has an embedded subform (sub_form_A). I would
    > > like to use SendObject to send what is in the subform, not the main form.
    > > SendObject allows you to send a form, which I am able to do. However, it is
    > > sending EVERY record in the table that the subform is bound to. I would like
    > > to only send the filtered data on the form. It is a listing of projects by
    > > user. One user may have 10 projects, another 5, another 20. The subform
    > > properly displays all the projects associated with that user, but when I do a
    > > SendObject with a "acFormatXLS", it creates a spreadsheet with every record
    > > in the table that sub_form_A is bound to.
    > > the Main form's (form_A) only control is used to display the user . This
    > > control is then used to filter the subform. BTW: If I SendObject the Main
    > > form, it only sends that user's name, though there are about 50 users in the
    > > table. So, SendObject on the main form works correctly.
    > >
    > > Any help would be appreciated.
     
    Anthony, Oct 16, 2008
    #3
  4. How about using Excel automation to create a new excel file with the sub-form
    data and e-mail it as your e-mail attachment. For a starting point in
    exporting the data you could look at
    http://www.databasejournal.com/features/msaccess/article.php/3563671
    --
    Hope this helps,

    Daniel Pineault
    http://www.cardaconsultants.com/
    For Access Tips and Examples: http://www.devhut.net
    Please rate this post using the vote buttons if it was helpful.



    "Anthony" wrote:

    > Thanks for your response. I was wanting to send it in XLS format and I read
    > in these discussions that Access will not allow a report to be sent in XLS
    > format. Also, since I wanted XLS format, I didn't want to bother with
    > report formatting.
    >
    > "Daniel Pineault" wrote:
    >
    > > One approach would be to create a report that return the sub-form values and
    > > e-mail a pdf of it (You can use lebans Report2PDF to generate the PDF file
    > > see http://www.lebans.com/reporttopdf.htm) .
    > > --
    > > Hope this helps,
    > >
    > > Daniel Pineault
    > > http://www.cardaconsultants.com/
    > > For Access Tips and Examples: http://www.devhut.net
    > > Please rate this post using the vote buttons if it was helpful.
    > >
    > >
    > >
    > > "Anthony" wrote:
    > >
    > > > I searched the Discussions but can't find anything that directly addresses my
    > > > issue. This is a fairly complicated issue but I know someone will be able to
    > > > help me.
    > > >
    > > > I have a form (form_A) that has an embedded subform (sub_form_A). I would
    > > > like to use SendObject to send what is in the subform, not the main form.
    > > > SendObject allows you to send a form, which I am able to do. However, it is
    > > > sending EVERY record in the table that the subform is bound to. I would like
    > > > to only send the filtered data on the form. It is a listing of projects by
    > > > user. One user may have 10 projects, another 5, another 20. The subform
    > > > properly displays all the projects associated with that user, but when I do a
    > > > SendObject with a "acFormatXLS", it creates a spreadsheet with every record
    > > > in the table that sub_form_A is bound to.
    > > > the Main form's (form_A) only control is used to display the user . This
    > > > control is then used to filter the subform. BTW: If I SendObject the Main
    > > > form, it only sends that user's name, though there are about 50 users in the
    > > > table. So, SendObject on the main form works correctly.
    > > >
    > > > Any help would be appreciated.
     
    Daniel Pineault, Oct 16, 2008
    #4
  5. Oh, me, oh, my, Norbert. That's a really timely response... only 3 1/2
    years after the question. Pardon me if I <GIGGLE> at the idea that the
    original poster is still hanging around waiting for an answer.

    But, I suppose someone who has a product that only does the same as a little
    code to create some SQL to use in an export has to take advantage of every
    opportunity to flog his add-in.

    --
    Larry Linson
    Microsoft Office Access MVP
    Co-Author, Microsoft Access Small Business Solutions, Wiley 2010

    "Norbert Limbersky" <> wrote in message
    news:...
    > Hi,
    >
    > AFAIK there no command or method in Access that would export only those
    > records of embedded subform that are related to current record of main
    > form.
    >
    > Nevertheless, you can easy do this with use of Access ad-in 'A2EE.mda'.
    >
    > This add-in has been specially developed for this kind of job.
    > It will export only those records of subform that are related to current
    > record of main form.
    >
    > The add-in has it's own user interface and many controls that setup how
    > will the export look like.
    >
    > You may find more on:
    > http://www.limbersti.cz/A2EE/
    >
    > Hope this helps
    > Norbert
    >
    >
    >> On Thursday, October 16, 2008 12:32 PM Anthon wrote:

    >
    >> I searched the Discussions but can't find anything that directly
    >> addresses my
    >> issue. This is a fairly complicated issue but I know someone will be able
    >> to
    >> help me.
    >>
    >> I have a form (form_A) that has an embedded subform (sub_form_A). I
    >> would
    >> like to use SendObject to send what is in the subform, not the main form.
    >> SendObject allows you to send a form, which I am able to do. However, it
    >> is
    >> sending EVERY record in the table that the subform is bound to. I would
    >> like
    >> to only send the filtered data on the form. It is a listing of projects
    >> by
    >> user. One user may have 10 projects, another 5, another 20. The
    >> subform
    >> properly displays all the projects associated with that user, but when I
    >> do a
    >> SendObject with a "acFormatXLS", it creates a spreadsheet with every
    >> record
    >> in the table that sub_form_A is bound to.
    >> the Main form's (form_A) only control is used to display the user . This
    >> control is then used to filter the subform. BTW: If I SendObject the
    >> Main
    >> form, it only sends that user's name, though there are about 50 users in
    >> the
    >> table. So, SendObject on the main form works correctly.
    >>
    >> Any help would be appreciated.

    >
    >
    >>> On Thursday, October 16, 2008 12:53 PM DanielPineaul wrote:

    >
    >>> One approach would be to create a report that return the sub-form values
    >>> and
    >>> e-mail a pdf of it (You can use lebans Report2PDF to generate the PDF
    >>> file
    >>> see http://www.lebans.com/reporttopdf.htm) .
    >>> --
    >>> Hope this helps,
    >>>
    >>> Daniel Pineault
    >>> http://www.cardaconsultants.com/
    >>> For Access Tips and Examples: http://www.devhut.net
    >>> Please rate this post using the vote buttons if it was helpful.
    >>>
    >>>
    >>>
    >>> "Anthony" wrote:

    >
    >
    >>>> On Thursday, October 16, 2008 1:24 PM Anthon wrote:

    >
    >>>> Thanks for your response. I was wanting to send it in XLS format and
    >>>> I read
    >>>> in these discussions that Access will not allow a report to be sent in
    >>>> XLS
    >>>> format. Also, since I wanted XLS format, I didn't want to bother
    >>>> with
    >>>> report formatting.
    >>>>
    >>>> "Daniel Pineault" wrote:

    >
    >
    >>>>> On Thursday, October 16, 2008 2:02 PM DanielPineaul wrote:

    >
    >>>>> How about using Excel automation to create a new excel file with the
    >>>>> sub-form
    >>>>> data and e-mail it as your e-mail attachment. For a starting point in
    >>>>> exporting the data you could look at
    >>>>> http://www.databasejournal.com/features/msaccess/article.php/3563671
    >>>>> --
    >>>>> Hope this helps,
    >>>>>
    >>>>> Daniel Pineault
    >>>>> http://www.cardaconsultants.com/
    >>>>> For Access Tips and Examples: http://www.devhut.net
    >>>>> Please rate this post using the vote buttons if it was helpful.
    >>>>>
    >>>>>
    >>>>>
    >>>>> "Anthony" wrote:

    >
    >
    >
     
    Access Developer, Jun 11, 2012
    #5
  6. Re: Oh, me, oh, my, Norbert. That's a really timely response...

    Sorry, Norbert. I don't do business with newsgroup spammers. Niether do most
    other participants here.

    And, if your original summary accurately describes what your product does, I
    can, and would rather, write the VBA code to accomplish the same purpose;
    then if something changed, I would easily be able to revise my VBA code to
    accomodate the change.

    --
    Larry Linson
    Microsoft Office Access MVP
    Co-Author, Microsoft Access Small Business Solutions, Wiley 2010

    "Norbert Limbersky" <> wrote in message
    news:...
    > Dear Larry,
    > it is my pleasure to see that my answer cought a Person like you.
    > You are absolutely right.
    > I first created product, then searched for how to sell it and recognized
    > Internet forums as a good start point.
    > So I searched questions / forums to which my product would fit as the
    > answer, just like this one.
    > Is it a bad approach?
    > I hope not, I hope this is the classic win-win strategy.
    > It may provide benefits to all who may in the future ask same/similar
    > question as was originaly put in this forum and in the same time provide
    > benefit to me as the product owner.
    > In this case I do not expect that originator of this forum will read it.
    > But this is why formums are public, isn't it? Someone else will read
    > original question and my response.
    >
    > It would be honor for me if you give a try to my product A2EE.mda.
    > You may be critical, but try it first.
    > Maybe you change your POV after you try it.
    > Maybe you event learn something.
    > BTW, I do not agree with you on saying that "...this product only does the
    > same as a little code to create some SQL to use in an export..."
    > Best regards
    > Norbert
    >
    >
    >> On Thursday, October 16, 2008 12:32 PM Anthon wrote:

    >
    >> I searched the Discussions but can't find anything that directly
    >> addresses my
    >> issue. This is a fairly complicated issue but I know someone will be able
    >> to
    >> help me.
    >>
    >> I have a form (form_A) that has an embedded subform (sub_form_A). I
    >> would
    >> like to use SendObject to send what is in the subform, not the main form.
    >> SendObject allows you to send a form, which I am able to do. However, it
    >> is
    >> sending EVERY record in the table that the subform is bound to. I would
    >> like
    >> to only send the filtered data on the form. It is a listing of projects
    >> by
    >> user. One user may have 10 projects, another 5, another 20. The
    >> subform
    >> properly displays all the projects associated with that user, but when I
    >> do a
    >> SendObject with a "acFormatXLS", it creates a spreadsheet with every
    >> record
    >> in the table that sub_form_A is bound to.
    >> the Main form's (form_A) only control is used to display the user . This
    >> control is then used to filter the subform. BTW: If I SendObject the
    >> Main
    >> form, it only sends that user's name, though there are about 50 users in
    >> the
    >> table. So, SendObject on the main form works correctly.
    >>
    >> Any help would be appreciated.

    >
    >
    >>> On Thursday, October 16, 2008 12:53 PM DanielPineaul wrote:

    >
    >>> One approach would be to create a report that return the sub-form values
    >>> and
    >>> e-mail a pdf of it (You can use lebans Report2PDF to generate the PDF
    >>> file
    >>> see http://www.lebans.com/reporttopdf.htm) .
    >>> --
    >>> Hope this helps,
    >>>
    >>> Daniel Pineault
    >>> http://www.cardaconsultants.com/
    >>> For Access Tips and Examples: http://www.devhut.net
    >>> Please rate this post using the vote buttons if it was helpful.
    >>>
    >>>
    >>>
    >>> "Anthony" wrote:

    >
    >
    >>>> On Thursday, October 16, 2008 1:24 PM Anthon wrote:

    >
    >>>> Thanks for your response. I was wanting to send it in XLS format and
    >>>> I read
    >>>> in these discussions that Access will not allow a report to be sent in
    >>>> XLS
    >>>> format. Also, since I wanted XLS format, I didn't want to bother
    >>>> with
    >>>> report formatting.
    >>>>
    >>>> "Daniel Pineault" wrote:

    >
    >
    >>>>> On Thursday, October 16, 2008 2:02 PM DanielPineaul wrote:

    >
    >>>>> How about using Excel automation to create a new excel file with the
    >>>>> sub-form
    >>>>> data and e-mail it as your e-mail attachment. For a starting point in
    >>>>> exporting the data you could look at
    >>>>> http://www.databasejournal.com/features/msaccess/article.php/3563671
    >>>>> --
    >>>>> Hope this helps,
    >>>>>
    >>>>> Daniel Pineault
    >>>>> http://www.cardaconsultants.com/
    >>>>> For Access Tips and Examples: http://www.devhut.net
    >>>>> Please rate this post using the vote buttons if it was helpful.
    >>>>>
    >>>>>
    >>>>>
    >>>>> "Anthony" wrote:

    >
    >
    >>>>>> On Monday, June 11, 2012 3:35 PM Norbert Limbersky wrote:

    >
    >>>>>> Hi,
    >>>>>>
    >>>>>>
    >>>>>>
    >>>>>> AFAIK there no command or method in Access that would export only
    >>>>>> those records of embedded subform that are related to current record
    >>>>>> of main form.
    >>>>>>
    >>>>>>
    >>>>>>
    >>>>>> Nevertheless, you can easy do this with use of Access ad-in
    >>>>>> 'A2EE.mda'.
    >>>>>>
    >>>>>>
    >>>>>>
    >>>>>> This add-in has been specially developed for this kind of job.
    >>>>>>
    >>>>>> It will export only those records of subform that are related to
    >>>>>> current record of main form.
    >>>>>>
    >>>>>>
    >>>>>>
    >>>>>> The add-in has it's own user interface and many controls that setup
    >>>>>> how will the export look like.
    >>>>>>
    >>>>>>
    >>>>>>
    >>>>>> You may find more on:
    >>>>>>
    >>>>>> http://www.limbersti.cz/A2EE/
    >>>>>>
    >>>>>>
    >>>>>>
    >>>>>> Hope this helps
    >>>>>>
    >>>>>> Norbert

    >
    >
    >>>>>>> On Monday, June 11, 2012 6:38 PM Access Developer wrote:

    >
    >>>>>>> Oh, me, oh, my, Norbert. That's a really timely response... only 3
    >>>>>>> 1/2
    >>>>>>> years after the question. Pardon me if I <GIGGLE> at the idea that
    >>>>>>> the
    >>>>>>> original poster is still hanging around waiting for an answer.
    >>>>>>>
    >>>>>>> But, I suppose someone who has a product that only does the same as
    >>>>>>> a little
    >>>>>>> code to create some SQL to use in an export has to take advantage of
    >>>>>>> every
    >>>>>>> opportunity to flog his add-in.
    >>>>>>>
    >>>>>>> --
    >>>>>>> Larry Linson
    >>>>>>> Microsoft Office Access MVP
    >>>>>>> Co-Author, Microsoft Access Small Business Solutions, Wiley 2010

    >
    >
    >
     
    Access Developer, Jul 26, 2012
    #6
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest

    DoCmd.SendObject - Send multiple objects

    Guest, Nov 20, 2003, in forum: Microsoft Access VBA Modules
    Replies:
    1
    Views:
    704
    Dev Ashish
    Nov 20, 2003
  2. Guest
    Replies:
    2
    Views:
    557
    Guest
    Feb 2, 2005
  3. Guest

    send two attachments using sendObject

    Guest, Jun 6, 2006, in forum: Microsoft Access VBA Modules
    Replies:
    2
    Views:
    329
    Guest
    Jun 7, 2006
  4. Guest

    can you send two objects in one email using the sendobject

    Guest, Sep 20, 2007, in forum: Microsoft Access VBA Modules
    Replies:
    4
    Views:
    667
    Guest
    Sep 21, 2007
  5. DontKnow

    Send an Query output with a Email using "sendObject" function

    DontKnow, Aug 28, 2009, in forum: Microsoft Access VBA Modules
    Replies:
    1
    Views:
    652
    Paolo
    Aug 28, 2009
Loading...

Share This Page