Sign Up |  Live StatsLive Stats    Articles 35,345| Comments 159,790| Members 17,820, Newest waheguruhelpme| Online 214
Home Contact
 (Forgotten?): 
    Sikhism

   
                                                                     Your Banner Here!    

Sikh Philosophy Network » Sikh Philosophy Network » Current Affairs » Information Technology » Form letter to multiple recipients with different body of text

Form letter to multiple recipients with different body of text

Our Donation Goal : Why Donate? : Donate Today! : Donate Anonymously (ਗੁਪਤ) : Our Family of Supporters
Goal this month: 400 USD, Received: 35 USD (9%)
Please Donate...
Related Topics...
Thread Thread Starter Forum Replies Last Post
ControlTip Text multiple lines Hindsey Information Technology 3 29-May-2009 04:26 AM
How to Repeat Text in Multiple Record Fields? Larry Bohen Information Technology 3 28-Jul-2006 08:36 AM
query function to take multiple text box value as criteria msmuzila@gmail.com Information Technology 1 28-Jul-2006 08:22 AM
Drop down lists to send multiple selections to a text field Iain Information Technology 6 28-Jul-2006 08:19 AM


Tags
form, letter, multiple, recipients, different, body, text
Reply Post New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!
  #1 (permalink)  
Old 28-Jul-2006, 08:38 AM
vavroom@gmail.com's Avatar vavroom@gmail.com
Guest
 
Posts: n/a
   
   
Form letter to multiple recipients with different body of text

  Donate Today!   Email to Friend  Tell a Friend   Show Printable Version  Print   Contact sikhphilosophy.net Administraion for any Suggestions, Ideas, Feedback.  Feedback  

Register to Remove Advertisements
So, for my next roadbump...

I'm having to send form letters every day, to multiple recipients.
Recipients are selected based on a date/daterange on a record. So far
so good.

I created a report which works as I want and displays things properly.
So far so good.

Where the problem begins, however, is that the letter should have a
different body of text, depending on the status of the recipient's
application (i.e. different letter if their application is approved, or
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/information-technology/13588-form-letter-multiple-recipients-different-body.html
declined, and if it's declined, different again depending on the reason
the application is declined).

I *could* create as many reports as I need letters, but this
complicates things in many ways. First, if you need to change the text
of the form letters (which happens periodically), you have to edit the
various reports. Then, you have to run each report based on the
date/daterange.

What I was thinking of doing is putting the letterbody in a table,
associated with an application status/declined explanation. Then when
the report is run, have it select the right text from the lettertext
table depending on the status, so the user can enter a date/daterange
on a form and click a button, and each record on the report would show
with the appropriate text/details.

I was able to do something that kinda worked, using a mixture of iif
and dlookup directly in a textfield in the report. But I'm concerned
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13588
about performance, and it seems rather unwieldy to do several nested
iif and dlookups.

I doing an if/else series of statements in code, and assigning the
value of the txtbox based on the result of these statements, but it
tells me I can't assign a value to the txtbox.

I'm not sure what to do next. Any idea?






 
Do share your immediate thoughts or reactions on this issue? We value your views! Login Now! or Sign Up Today! to share your views with us.. Gurfateh!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 28-Jul-2006, 08:38 AM
Arvin Meyer [MVP]'s Avatar Arvin Meyer [MVP]
Guest
 
Posts: n/a
   
   
Re: Form letter to multiple recipients with different body of text

Consider using a recordset instead of DLookup:

Function FastLookup(strFieldName As String, _
strTableName As String, _
strWhere As String) As Variant
'Arvin Meyer 4/9/1997

Dim strSQL As String
Dim rst As DAO.Recordset
Dim db As DAO.Database

Set db = CurrentDb

strSQL = "SELECT " & strFieldName & " FROM " & _
strTableName & " WHERE " & strWhere & ";"

Set rst = db.OpenRecordset(strSQL, dbOpenSnapshot)

If rst.RecordCount <> 0 Then
FastLookup = rst(strFieldName)
Else
FastLookup = Null
End If

End Function
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access

wrote in message
news:1153366397.282083.39010@m79g2000cwm.googlegro ups.com...
> So, for my next roadbump...
>
> I'm having to send form letters every day, to multiple recipients.
> Recipients are selected based on a date/daterange on a record. So far
> so good.
>
> I created a report which works as I want and displays things properly.
> So far so good.
>
> Where the problem begins, however, is that the letter should have a
> different body of text, depending on the status of the recipient's
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13588
> application (i.e. different letter if their application is approved, or
> declined, and if it's declined, different again depending on the reason
> the application is declined).
>
> I *could* create as many reports as I need letters, but this
> complicates things in many ways. First, if you need to change the text
> of the form letters (which happens periodically), you have to edit the
> various reports. Then, you have to run each report based on the
> date/daterange.
>
> What I was thinking of doing is putting the letterbody in a table,
> associated with an application status/declined explanation. Then when
> the report is run, have it select the right text from the lettertext
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13588
> table depending on the status, so the user can enter a date/daterange
> on a form and click a button, and each record on the report would show
> with the appropriate text/details.
>
> I was able to do something that kinda worked, using a mixture of iif
> and dlookup directly in a textfield in the report. But I'm concerned
> about performance, and it seems rather unwieldy to do several nested
> iif and dlookups.
>
> I doing an if/else series of statements in code, and assigning the
> value of the txtbox based on the result of these statements, but it
> tells me I can't assign a value to the txtbox.
>
> I'm not sure what to do next. Any idea?
>



Reply With Quote
  #3 (permalink)  
Old 28-Jul-2006, 08:38 AM
vavroom@gmail.com's Avatar vavroom@gmail.com
Guest
 
Posts: n/a
   
   
Re: Form letter to multiple recipients with different body of text

Thanks Arvin,

I would have considered it if I had known (or knew) how do to so. This
is a bit beyond my meagre abilities.

I'm having a problem using your suggested function.

I've pasted it in a new module. Now, from my reading of this, I should
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13588
pass the strFieldName, strTableName and strWhere when calling the
function, as such:

FastLookup ("fldLetterText", "tblLetterText", "fldLetterTextID=2")

Which I called like this:
me.txtLetterText = FastLookup ("fldLetterText", "tblLetterText",
"fldLetterTextID=2")

This gives me a compile error expected variable or procedure, not
module.

So I figure, ok, the function shouldn't live in a module. I trashed
the module, put the function in the report's window.

This then gave me a compile error user-defined type not defined, and
highlights "dim rst as dao.recordset".

I suspect I'm missing something obvious, but as the nose in the middle
of my face, I cant' see it
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13588

Thanks for any further assistance you might be able to provide.

Reply With Quote
  #4 (permalink)  
Old 28-Jul-2006, 08:38 AM
Arvin Meyer [MVP]'s Avatar Arvin Meyer [MVP]
Guest
 
Posts: n/a
   
   
Re: Form letter to multiple recipients with different body of text

I'm not sure what you are doing wrong. The code goes in a module (I use a
Standard module because I call it from everywhere). I just tested it again,
I tested the code directly from the newsgroup posting, to be sure I hadn't
missed something, and it works fine.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13588
http://www.mvps.org/access

wrote in message
news:1153439734.542137.17680@s13g2000cwa.googlegro ups.com...
> Thanks Arvin,
>
> I would have considered it if I had known (or knew) how do to so. This
> is a bit beyond my meagre abilities.
>
> I'm having a problem using your suggested function.
>
> I've pasted it in a new module. Now, from my reading of this, I should
> pass the strFieldName, strTableName and strWhere when calling the
> function, as such:
>
> FastLookup ("fldLetterText", "tblLetterText", "fldLetterTextID=2")
>
> Which I called like this:
> me.txtLetterText = FastLookup ("fldLetterText", "tblLetterText",
> "fldLetterTextID=2")
>
> This gives me a compile error expected variable or procedure, not
> module.
>
> So I figure, ok, the function shouldn't live in a module. I trashed
> the module, put the function in the report's window.
>
> This then gave me a compile error user-defined type not defined, and
> highlights "dim rst as dao.recordset".
>
> I suspect I'm missing something obvious, but as the nose in the middle
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13588
> of my face, I cant' see it
>
> Thanks for any further assistance you might be able to provide.
>



Reply With Quote
  #5 (permalink)  
Old 28-Jul-2006, 08:40 AM
vavroom@gmail.com's Avatar vavroom@gmail.com
Guest
 
Posts: n/a
   
   
Re: Form letter to multiple recipients with different body of text

> I'm not sure what you are doing wrong. The code goes in a module (I use a
> Standard module because I call it from everywhere). I just tested it again,
> I tested the code directly from the newsgroup posting, to be sure I hadn't
> missed something, and it works fine.


I don't know either. Hmmm.

I'll try it in a cleaned up/simplified DB.
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13588

/me scratches head.

Reply With Quote
  #6 (permalink)  
Old 28-Jul-2006, 08:40 AM
vavroom@gmail.com's Avatar vavroom@gmail.com
Guest
 
Posts: n/a
   
   
Re: Form letter to multiple recipients with different body of text

  Donate Today!  
Got it! And it works. Thanks Arvin, this is brilliant.

Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13588
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=13588
I dug in some, and finally figured out that for some reason the MS DAO
3.6 Object Library wasnt' "ticked" in the references... Did that, and
now it works like a charm. Still fiddling to do to create the WHERE
statement, but that shouldn't be that complicated.

Cheers, I *much* appreciate your assistance.

Reply With Quote
   Click Here to Donate Now!

Support Us!
Become a Promoter!
Gurfateh ji, you can become a SPN Promoter by Donating as little as $10 each month. With limited resources & high operational costs, your donations make it possible for us to deliver a quality website and spread the teachings of the Sri Guru Granth Sahib Ji, to serve & uplift humanity. Every contribution counts. Donate Generously. Gurfateh!
ReplyPost New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!

Bookmarks


(View-All Members who have read this thread : 0
There are no names to display.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Tools Search
Search:

Advanced Search
Display Modes

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 On
Trackbacks are On
Pingbacks are On
Refbacks are On

» Gurbani Jukebox
Listen to Gurbani while surfing SPN!
» Active Discussions
sikhism Who is "Mohan"?
Today 08:46 AM
22 Replies, 335 Views
sikhism How important is Matha...
Today 08:12 AM
59 Replies, 1,038 Views
sikhism need urgent advice.......
Today 06:46 AM
6 Replies, 81 Views
sikhism ਨਾਮਾ
Today 06:37 AM
2 Replies, 53 Views
sikhism Sikh Diamonds Video...
Today 04:23 AM
6 Replies, 116 Views
sikhism Are Creator and Creation...
Today 01:30 AM
44 Replies, 2,837 Views
sikhism Herman Hesse,...
Today 00:54 AM
13 Replies, 229 Views
sikhism On a Scale of Most...
Yesterday 21:42 PM
30 Replies, 1,277 Views
sikhism I became victim by...
Yesterday 19:50 PM
0 Replies, 44 Views
sikhism Sikh Books downloads
Yesterday 15:39 PM
2 Replies, 66 Views
sikhism Salok Sheikh Farid ji...
Yesterday 09:35 AM
0 Replies, 47 Views
sikhism In Punjab, three farmers...
Yesterday 05:36 AM
0 Replies, 49 Views
sikhism Supernatural Sikhs, what...
Yesterday 03:45 AM
19 Replies, 414 Views
sikhism Sukhmani Sahib Astpadi...
26-May-2012 22:57 PM
0 Replies, 51 Views
Do You Think You Are...
26-May-2012 09:59 AM
94 Replies, 8,258 Views
» Books You Should Read...
Powered by vBadvanced CMPS v3.2.2

All times are GMT +6.5. The time now is 09:36 AM.
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.5.2 Copyright © 2004-12, All Rights Reserved. Sikh Philosophy Network


Page generated in 0.44510 seconds with 30 queries