Jumat, 19 Desember 2014

RE: [MS_AccessPros] Convert reports (letters with if conditions) from Access 2013 to Word 2013

 

Norbert,
Are you asking how to automate a merge to Word?
 
I think one of your issues is that you are storing data in your code. Every bit of text inside quotes in your code should be in tables, not code. Once your data is in tables, you should be able to include the data in your query for creating a merge dataset.
 
Duane Hookom MVP
MS Access
 

To: MS_Access_Professionals@yahoogroups.com
From: MS_Access_Professionals@yahoogroups.com
Date: Fri, 19 Dec 2014 05:26:03 -0800
Subject: [MS_AccessPros] Convert reports (letters with if conditions) from Access 2013 to Word 2013



        Happy Holidays!
Any suggestions how to use MERGEFIELD process with Automation using Access 2013 and Word 2013?


Many times a manager wants to change the content of a letter. The easier way instead of changing in the Access hard code procedure will be to change it in a Word Template.
As you can observe in the sample below there are case conditions which could be converted into a Word Template. I have no experience in this field and will appreciate any feedback.
Thanks a lot.
Norbert




Example:
The following is a partial code from a report which creates a letter in Access 2013:
(Sorry I can't format to change this code to a better view please advise if will help to post all the code of this procedure)


Select Case Me.CollectionMode
    Case "Ccard"
        Me.p_main = Me.p_main & " " & LCase(Me.EFTCollCycle) & " " & " credit card charge for the premium payment on your"
        If Me.prodcde <> "ANTY" Then
            Me.p_main = Me.p_main & " " & "FREEDOMFLEX life insurance underwritten by Fidelity Security Life Company has been declined."
        Else
            Me.p_main = Me.p_main & " " & "annuity underwritten by Fidelity Security Life has been declined."
        End If
        Me.p_main = Me.p_main & vbCrLf & vbCrLf & "This may have been an oversight, and perhaps it is still         your " & _ "desire to continue to have automatic premium payments charged to " & _
                         "your credit card each month.  If you wish to maintain your valuable plan, " & _
                         "please send us a personal check to replace the charge plus an additional " &                sp_nsf_ser_chg & _
                                         " service charge to cover our bank's charges as stated in your service agreement."
        If Me.prodcde <> "ANTY" Then
            Me.p_main2 = vbCrLf & "FAILURE TO PAY THE AMOUNT DUE MAY RESULT IN A LAPSE IN YOUR FREEDOMFLEX COVERAGE.  " & _
                         "ALTHOUGH WE MAY CONTINUE TO CHARGE YOUR CREDIT CARD WHEN YOU HAVE MISSED A PAYMENT, " & _
                         "YOUR COVERAGE MAY NOT BE IN FORCE IN THE EVENT OF A CLAIM AGAINST IT, IF THAT PAYMENT HAS NOT BEEN REMITTED."
        End If

    Case Else
        Me.p_main = Me.p_main & " " & "monthly Electronic Funds Transfer for the premium payment on your "
        If Me.prodcde <> "ANTY" Then
            Me.p_main = Me.p_main & " " & "FREEDOMFLEX life insurance underwritten by Fidelity Security Life has not been honored."
        Else
            Me.p_main = Me.p_main & " " & "annuity underwritten by Fidelity Security Life has not been honored."
        End If
        Me.p_main = Me.p_main & vbCrLf & vbCrLf & "This may have been an oversight, and perhaps it is still your " & _
                                         "desire to continue to have automatic premium deductions from your account each month. " & _
                                         "If you wish to maintain your valuable plan, please send us a personal check to replace the transfer " & _
                                         "plus an additional " & sp_nsf_ser_chg & " service charge to cover our bank's charges as stated in your service agreement. " & _
                                         "You may choose to make this payment through your credit card by contacting this office."
        If Me.prodcde <> "ANTY" Then
            Me.p_main2 = vbCrLf & "FAILURE TO PAY THE AMOUNT DUE MAY RESULT IN A LAPSE IN YOUR FREEDOMFLEX COVERAGE.  " & _
                         "ALTHOUGH WE MAY CONTINUE TO DRAFT WHEN YOU HAVE MISSED A PAYMENT, " & _
                         "YOUR COVERAGE MAY NOT BE IN FORCE IN THE EVENT OF A CLAIM AGAINST IT, IF THAT PAYMENT HAS NOT BEEN REMITTED."
       End If
End Select
'---------------------------------------Client name-------------------------------------------
If Not IsNothing(strClientMN) Then
        strClient = strClientFN & " " & strClientMN & " " & strClientLN
Else
        strClient = strClientFN & " " & strClientLN
End If
'----------------------------------------Payor Name-------------------------------------------
If Not IsNothing(strPayorFN) Then
        strPayor = strPayorFN & " " & strPayorLN
Else
        strPayor = strClient
End If
'----------------------------------head_*       -----------------------------------------------



__._,_.___

Posted by: Duane Hookom <duanehookom@hotmail.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)

.

__,_._,___

Tidak ada komentar:

Posting Komentar