PC Review


Reply
Thread Tools Rate Thread

change filename output of sendobject

 
 
=?Utf-8?B?cmljbw==?=
Guest
Posts: n/a
 
      23rd Jan 2006
Hi all,

i want to be able to send a report "emailinvoice" by email but with the
invoice number as part of the file name eg. emailinvoice-346.

At the moment i'm using the sendobject function to export the report. The
ony way i can think of doing what i want, is to create a new report each time
the report is emailed doing something like this.

Dim newinvoice as string
newinvoice = "emailinvoice-" & Me.invoiceno
CreateReport newinvoice, emailinvoice
Docmd.sendobject acreport, newinvoice etc etc

Then delete the report i have created once it has been sent. But this would
make my users front ends expand in size extremely quickly and need compacting
repairing more than a few times a day, plus i'm sure there is a more
efficient way of doing this, any ideas??

TIA

Rico
 
Reply With Quote
 
 
 
 
Allen Browne
Guest
Posts: n/a
 
      23rd Jan 2006
Rico, my experience is that Access uses the Caption of the report as the
name, or or Name of the report if there is no caption. Although you can set
the report's Caption in its Open event, that seems to be too late, i.e. that
does not affect the file name.

You might like to try experimenting with renaming the report:
DoCmd.Rename "Invoice 346", acReport, "Invoice"
and see if that is less bloating than creating and destroying it.

I don't know if you can get away with doing that in an MDE, but anything
that prevents you from creating an MDE for your users is not a suitable
generic development technique.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"rico" <(E-Mail Removed)> wrote in message
news:58C3D481-2F5D-4AA0-ADC7-(E-Mail Removed)...
>
> i want to be able to send a report "emailinvoice" by email but with the
> invoice number as part of the file name eg. emailinvoice-346.
>
> At the moment i'm using the sendobject function to export the report. The
> ony way i can think of doing what i want, is to create a new report each
> time
> the report is emailed doing something like this.
>
> Dim newinvoice as string
> newinvoice = "emailinvoice-" & Me.invoiceno
> CreateReport newinvoice, emailinvoice
> Docmd.sendobject acreport, newinvoice etc etc
>
> Then delete the report i have created once it has been sent. But this
> would
> make my users front ends expand in size extremely quickly and need
> compacting
> repairing more than a few times a day, plus i'm sure there is a more
> efficient way of doing this, any ideas??
>
> TIA
>
> Rico



 
Reply With Quote
 
=?Utf-8?B?cmljbw==?=
Guest
Posts: n/a
 
      23rd Jan 2006
Thanks Allen,

The renaming works quite well, doesn't bulk it up too much, well not as much
as creating/deleting! gonna trail it for a couple of days, see how it goes.

Also might try exporting the details to a word template, thought i read
something a while back about doing it, know anything about it?

Thanks again for the help.

Rico

"Allen Browne" wrote:

> Rico, my experience is that Access uses the Caption of the report as the
> name, or or Name of the report if there is no caption. Although you can set
> the report's Caption in its Open event, that seems to be too late, i.e. that
> does not affect the file name.
>
> You might like to try experimenting with renaming the report:
> DoCmd.Rename "Invoice 346", acReport, "Invoice"
> and see if that is less bloating than creating and destroying it.
>
> I don't know if you can get away with doing that in an MDE, but anything
> that prevents you from creating an MDE for your users is not a suitable
> generic development technique.
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia.
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "rico" <(E-Mail Removed)> wrote in message
> news:58C3D481-2F5D-4AA0-ADC7-(E-Mail Removed)...
> >
> > i want to be able to send a report "emailinvoice" by email but with the
> > invoice number as part of the file name eg. emailinvoice-346.
> >
> > At the moment i'm using the sendobject function to export the report. The
> > ony way i can think of doing what i want, is to create a new report each
> > time
> > the report is emailed doing something like this.
> >
> > Dim newinvoice as string
> > newinvoice = "emailinvoice-" & Me.invoiceno
> > CreateReport newinvoice, emailinvoice
> > Docmd.sendobject acreport, newinvoice etc etc
> >
> > Then delete the report i have created once it has been sent. But this
> > would
> > make my users front ends expand in size extremely quickly and need
> > compacting
> > repairing more than a few times a day, plus i'm sure there is a more
> > efficient way of doing this, any ideas??
> >
> > TIA
> >
> > Rico

>
>
>

 
Reply With Quote
 
Allen Browne
Guest
Posts: n/a
 
      23rd Jan 2006
Rico, I personally avoid that kind of DDE interchange between Word and
Access, so others might be able to suggest how to avoid the pitfalls there.

Personally, I find that kind of thing too unstable to use.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"rico" <(E-Mail Removed)> wrote in message
news:1A329734-42C0-4266-BCEE-(E-Mail Removed)...
> Thanks Allen,
>
> The renaming works quite well, doesn't bulk it up too much, well not as
> much
> as creating/deleting! gonna trail it for a couple of days, see how it
> goes.
>
> Also might try exporting the details to a word template, thought i read
> something a while back about doing it, know anything about it?
>
> Thanks again for the help.
>
> Rico
>
> "Allen Browne" wrote:
>
>> Rico, my experience is that Access uses the Caption of the report as the
>> name, or or Name of the report if there is no caption. Although you can
>> set
>> the report's Caption in its Open event, that seems to be too late, i.e.
>> that
>> does not affect the file name.
>>
>> You might like to try experimenting with renaming the report:
>> DoCmd.Rename "Invoice 346", acReport, "Invoice"
>> and see if that is less bloating than creating and destroying it.
>>
>> I don't know if you can get away with doing that in an MDE, but anything
>> that prevents you from creating an MDE for your users is not a suitable
>> generic development technique.
>>
>>
>> "rico" <(E-Mail Removed)> wrote in message
>> news:58C3D481-2F5D-4AA0-ADC7-(E-Mail Removed)...
>> >
>> > i want to be able to send a report "emailinvoice" by email but with the
>> > invoice number as part of the file name eg. emailinvoice-346.
>> >
>> > At the moment i'm using the sendobject function to export the report.
>> > The
>> > ony way i can think of doing what i want, is to create a new report
>> > each
>> > time
>> > the report is emailed doing something like this.
>> >
>> > Dim newinvoice as string
>> > newinvoice = "emailinvoice-" & Me.invoiceno
>> > CreateReport newinvoice, emailinvoice
>> > Docmd.sendobject acreport, newinvoice etc etc
>> >
>> > Then delete the report i have created once it has been sent. But this
>> > would
>> > make my users front ends expand in size extremely quickly and need
>> > compacting
>> > repairing more than a few times a day, plus i'm sure there is a more
>> > efficient way of doing this, any ideas??



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change the output filename by using rundll32.exe C:\WINDOWS\system32\shimgvw.dll,ImageView_PrintTo %1 %2 %3 %4 huangbo888@gmail.com Windows XP Print / Fax 1 28th Feb 2006 06:29 PM
How to change the output filename by using rundll32.exe C:\WINDOWS\system32\shimgvw.dll,ImageView_PrintTo %1 %2 %3 %4 huangbo888@gmail.com Windows XP Help 2 26th Feb 2006 02:53 AM
PDF output with Cell as filename =?Utf-8?B?U2NvdHQgWmllcmxlcg==?= Microsoft Excel Worksheet Functions 2 30th Jun 2005 02:42 PM
Output to filename with datestamp? =?Utf-8?B?Sm9obks=?= Microsoft Access 2 1st Mar 2005 08:03 PM
Edit XLS output from SendObject method? NoSpamTakeSquareRootOfNumber Microsoft Access External Data 1 29th Jul 2004 12:33 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:29 PM.