RP1America
Technical User
While using the Compile Project option, I ran into the error: "Compile Error: Block If without End If" with the "End Sub" highlighted.
Any ideas as to why this may be occuring? I cannot figure it out. All other debugging within this procedure has been accounted for.
Thanks!!
Any ideas as to why this may be occuring? I cannot figure it out. All other debugging within this procedure has been accounted for.
Thanks!!
Code:
Private Sub beneinfcont_click()
Dim strperiod As String
If period = "1" Then strperiod = "One"
If period = "2" Then strperiod = "Two"
If period = "3" Then strperiod = "Three"
If period = "4" Then strperiod = "Four"
If period = "5" Then strperiod = "Five"
If period = "6" Then strperiod = "Six"
If period = "7" Then strperiod = "Seven"
If period = "8" Then strperiod = "Eight"
If period = "9" Then strperiod = "Nine"
If period = "10" Then strperiod = "Ten"
If period = "11" Then strperiod = "Eleven"
If period = "12" Then strperiod = "Twelve"
If period = "13" Then strperiod = "Thirteen"
If period = "14" Then strperiod = "Fourteen"
If period = "15" Then strperiod = "Fifteen"
If period = "16" Then strperiod = "Sixteen"
If period = "17" Then strperiod = "Seventeen"
If period = "18" Then strperiod = "Eighteen"
If period = "19" Then strperiod = "Nineteen"
If period = "20" Then strperiod = "Twenty"
If period = "21" Then strperiod = "Twenty-One"
If period = "22" Then strperiod = "Twenty-Two"
If period = "23" Then strperiod = "Twenty-Three"
If period = "24" Then strperiod = "Twenty-Four"
If period = "25" Then strperiod = "Twenty-Five"
If period = "26" Then strperiod = "Twenty-Six"
If period = "27" Then strperiod = "Twenty-Seven"
If period = "28" Then strperiod = "Twenty-Eight"
If period = "29" Then strperiod = "Twenty-Nine"
If period = "30" Then strperiod = "Thirty"
If period = "31" Then strperiod = "Thirty-One"
If period = "32" Then strperiod = "Thirty-Two"
If period = "33" Then strperiod = "Thirty-Three"
If period = "34" Then strperiod = "Thirty-Four"
If period = "35" Then strperiod = "Thirty-Five"
If period = "36" Then strperiod = "Thirty-Six"
If period = "37" Then strperiod = "Thirty-Seven"
If period = "38" Then strperiod = "Thirty-Eight"
If period = "39" Then strperiod = "Thirty-Nine"
If period = "40" Then strperiod = "Fourty"
If period = "41" Then strperiod = "Fourty-One"
If period = "42" Then strperiod = "Fourty-Two"
If period = "43" Then strperiod = "Fourty-Three"
If period = "44" Then strperiod = "Fourty-Four"
If period = "45" Then strperiod = "Fourty-Five"
If period = "46" Then strperiod = "Fourty-Six"
If period = "47" Then strperiod = "Fourty-Seven"
If period = "48" Then strperiod = "Fourty-Eight"
If period = "49" Then strperiod = "Fourty-Nine"
If period = "50" Then strperiod = "Fifty"
If period >= "50" Then strperiod = period
Dim strperiodmys As String
If annuityinfo.periodmonths = True Then strperiodmys = " months"
If annuityinfo.periodyears = True Then strperiodmys = " years"
Dim strsex2 As String
If annuitantinfo.annuitantsal.Value = "Mr." Then strsex2 = "his"
If annuitantinfo.annuitantsal.Value = "Mrs." Then strsex2 = "her"
If annuitantinfo.annuitantsal.Value = "Ms." Then strsex2 = "her"
Dim strnumbenes As String
If Not bene1first.Value = "" And Not bene2first.Value = "" Then strnumbenes = "beneficiaries"
If Not bene1first.Value = "" And bene2first.Value = "" Then strnumbenes = "beneficiary"
Dim strisare As String
If Not bene1first.Value = "" And Not bene2first.Value = "" Then strisare = "are"
If Not bene1first.Value = "" And bene2first.Value = "" Then strisare = "is"
Dim stryou2 As String
If addresseeinfo.addresseefirst.Value = bene1first.Value And addresseeinfo.addresseelast.Value = bene1last.Value Then
stryou2 = "you, "
If addresseeinfo.addresseefirst.Value = Not bene1first.Value And addresseeinfo.addresseelast.Value = Not bene1last.Value Then
stryou2 = ""
Dim strbenenames As String
If ssayes = True And Not bene1first.Value = "" And Not bene2first.Value = "" And Not bene3first.Value = "" _
And Not bene4first.Value = "" And bene5first.Value = "" Then
strbenenames = stryou2 + bene1first.Value + " " + bene1last.Value + ", " + bene2first.Value + " " + bene2last.Value _
+ ", " + bene3first.Value + " " + bene3last.Value + ", " + bene4first.Value + " " + bene4last.Value + ", and " + _
bene5first.Value + " " + bene5last.Value + " to share equally"
If ssayes = True And Not bene1first.Value = "" And Not bene2first.Value = "" And Not bene3first.Value = "" _
And Not bene4first.Value = "" Then
strbenenames = stryou2 + bene1first.Value + " " + bene1last.Value + ", " + bene2first.Value + " " + bene2last.Value + _
", " + bene3first.Value + " " + bene3last.Value + ", and " + bene4first.Value + " " + bene4last.Value + " to share equally"
If ssayes = True And Not bene1first.Value = "" And Not bene2first.Value = "" And Not bene3first.Value = "" Then
strbenenames = stryou2 + bene1first.Value + " " + bene1last.Value + ", " + bene2first.Value + " " + bene2last.Value + _
", and " + bene3first.Value + " " + bene3last.Value + " to share equally"
If ssayes = True And Not bene1first.Value = "" And Not bene2first.Value = "" Then
strbenenames = stryou2 + bene1first.Value + " " + bene1last.Value + ", and " + bene2first.Value + " " + bene2last.Value + _
" to share equally"
If ssayes = True And Not bene1first.Value = "" Then
strbenenames = stryou2 + bene1first.Value + " " + bene1last.Value
If ssano = True And Not bene1first.Value = "" And Not bene2first.Value = "" And Not bene3first.Value = "" _
And Not bene4first.Value = "" And bene5first.Value = "" Then
strbenenames = stryou2 + bene1first.Value + " " + bene1last.Value + " - " + bene1per.Value + ", " + bene2first.Value + _
" " + bene2last.Value + " - " + bene2per.Value + ", " + bene3first.Value + " " + bene3last.Value + " - " + bene3per.Value + _
", " + bene4first.Value + " " + bene4last.Value + " - " + bene4per.Value + ", and " + bene5first.Value + " " + _
bene5last.Value + " - " + bene5per.Value
If ssano = True And Not bene1first.Value = "" And Not bene2first.Value = "" And Not bene3first.Value = "" _
And Not bene4first.Value = "" Then
strbenenames = stryou2 + bene1first.Value + " " + bene1last.Value + " - " + bene1per.Value + ", " + bene2first.Value + _
" " + bene2last.Value + " - " + bene2per.Value + ", " + bene3first.Value + " " + bene3last.Value + " - " + bene3per.Value + _
", and " + bene4first.Value + " " + bene4last.Value + " - " + bene4per.Value
If ssano = True And Not bene1first.Value = "" And Not bene2first.Value = "" And Not bene3first.Value = "" Then
strbenenames = stryou2 + bene1first.Value + " " + bene1last.Value + " - " + bene1per.Value + ", " + bene2first.Value + _
" " + bene2last.Value + " - " + bene2per.Value + ", and " + bene3first.Value + " " + bene3last.Value + " - " + bene3per.Value
If ssano = True And Not bene1first.Value = "" And Not bene2first.Value = "" Then
strbenenames = stryou2 + bene1first.Value + " " + bene1last.Value + " - " + bene1per.Value + ", and " + bene2first.Value + _
" " + bene2last.Value + " - " + bene1per.Value
If ssano = True And Not bene1first.Value = "" Then
strbenenames = stryou2 + bene1first.Value + " " + bene1last.Value
Dim strnumregpyts As String
If annuityinfo.annoption = "Fixed Amount" And annuityinfo.benefityes = True Then
strnumregpyts = (annuityinfo.numpytsduebene.Value - 1)
If annuityinfo.annoption = "Installment Refund" And annuityinfo.benefityes = True Then
strnumregpyts = (annuityinfo.numpytsduebene.Value - 1)
Dim strjscalcpercent As String
If annuityinfo.jspercent = "50%" Then strjscalcpercent = Format$(annuityinfo.gross * 0.5, "$#,##0.00")
If annuityinfo.jspercent = "66%" Then strjscalcpercent = Format$(annuityinfo.gross * 0.666, "$#,##0.00")
If annuityinfo.jspercent = "75%" Then strjscalcpercent = Format$(annuityinfo.gross * 0.75, "$#,##0.00")
If annuityinfo.jspercent = "100%" Then strjscalcpercent = Format$(annuityinfo.gross * 1, "$#,##0.00")
With ActiveDocument
' Benefits Due (No Contingent Benefits Available Per Annuity Type)
If annuityinfo.annoption.Value = "Fixed Period" And annuityinfo.benefityes = True Then
.Bookmarks("annoptionspecs").Range.Text = LCase(strperiod) + strperiodmys + ". There are " + _
annuityinfo.numpytsduebene.Value + " payments left on this annuity to be paid to " + strsex2 + " " + strnumbenes + _
", who " + strisare + " " + strbenenames + "."
ElseIf annuityinfo.annoption.Value = "Fixed Amount" And annuityinfo.benefityes = True Then
.Bookmarks("annoptionspecs").Range.Text = annuityinfo.instrefnumpyts + " payments and a final payment of " + _
annuityinfo.instreffinal + ". There are " + strnumregpyts + " payments of " + annuityinfo.gross + _
" and a final payment of " + annuityinfo.instreffinal + " left on this annuity to be paid to " + strsex2 + " " + _
strnumbenes + ", who " + strisare + " " + strbenenames + "."
ElseIf annuityinfo.annoption.Value = "Certain and Life" And annuityinfo.benefityes = True Then
.Bookmarks("annoptionspecs").Range.Text = LCase(strperiod) + strperiodmys + " and life thereafter. There are " + _
annuityinfo.numpytsduebene.Value + " payments left on this annuity to be paid to " + strsex2 + " " + strnumbenes + _
", who " + strisare + " " + strbenenames + "."
ElseIf annuityinfo.annoption.Value = "Installment Refund" And annuityinfo.benefityes = True Then
.Bookmarks("annoptionspecs").Range.Text = annuityinfo.instrefnumpyts + " installments and a final payment of " + _
annuityinfo.instreffinal + " and for life thereafter. There are " + strnumregpyts + " installments of " + _
annuityinfo.gross + " and a final payment of " + annuityinfo.instreffinal + " left on this annuity to be paid to " + _
strsex2 + " " + strnumbenes + ", who " + strisare + " " + strbenenames + "."
End If
' Benefits Due (To Contingent)
If annuityinfo.annoption = "Joint and Survivor" And contingentbeneyes = True Then
.Bookmarks("annoptionspecs").Range.Text = strsex2 + " lifetime. Upon " + strsex2 + " death, " + stryou2 + _
annuityinfo.contingentfirst + " " + annuityinfo.contingentlast + " will receive " + annuityinfo.jspercent + " of what " + _
annuitantinfo.annuitantsal.Value + " " + annuitantinfo.annuitantlast.Value + " was receiving, which will be " + _
strjscalcpercent + " " + LCase(annuityinfo.freq) + " for your lifetime."
ElseIf annuityinfo.annoption = "Joint and Survivor with Certain and Life" And contingentbeneyes = True Then
.Bookmarks("annoptionspecs").Range.Text = LCase(strperiod) + strperiodmys + " and for life thereafter. Upon " + _
strsex2 + " death, " + stryou + annuityinfo.contingentfirst + " " + annuityinfo.contingentlast + " will receive " + _
annuityinfo.jspercent + " of what " + annuitantinfo.annuitantsal.Value + " " + annuitantinfo.annuitantlast.Value + _
" was receiving, which will be " + strjscalcpercent + " " + LCase(annuityinfo.freq) + " for your lifetime."
ElseIf annuityinfo.annoption = "Joint and Contingent" And contingentbeneyes = True Then
.Bookmarks("annoptionspecs").Range.Text = strsex2 + " lifetime. Upon " + strsex2 + " death, " + stryou2 + _
annuityinfo.contingentfirst + " " + annuityinfo.contingentlast + " will receive " + annuityinfo.jspercent + " of what " + _
annuitantinfo.annuitantsal.Value + " " + annuitantinfo.annuitantlast.Value + " was receiving, which will be " + _
strjscalcpercent + " " + LCase(annuityinfo.freq) + " for your lifetime."
End If
' Benefits Due (NOT To Contingent)
If annuityinfo.annoption = "Joint and Survivor with Certain and Life" And contingentbeneno = True Then
.Bookmarks("annoptionspecs").Range.Text = LCase(strperiod) + strperiodmys + _
" and for life thereafter. Since the contingent annuitant, " + annuityinfo.contingentfirst + " " + _
annuityinfo.contingentlast + ", is also deceased, there are " + annuityinfo.numpytsduebene + _
" payments left on this annuity to be paid to " + strsex2 + " " + strnumbenes + ", who " + strisare + " " + _
strbenenames + "."
End If
End With
Me.Hide
Load additionalinfo
additionalinfo.Show
End Sub