[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.2

If Statement Help

Asked by quizzer in Microsoft Access Database, Access Coding/Macros

Tags: Microsoft, Access, 2003, If Statement


I have the following code on a button

The problem I am having is with an If Statement to finalize actions
I need to evaluate if all of my sPromoteResults statements are ALL<> True and if so pop up a message box and Exit the Sub.  This works

However for each individual sPromoteResuts if the condition is True I want it to do something
Problem is it stops on the first True condition and never goes forward
so if I have the condition If spromoteresultsNew1 = True it should do something and
If spromoteresultsNew2 = True Then it should perform another action
It is stopping after here

How can Iensure that for every True condition it performs an action and if all 10 are <>True it gives the MsgBox and Exits Sub

Thanks

*Problem Section*******

If spromoteresultsNew1 <> True And spromoteresultsNew2 <> True And spromoteresultsNew3 <> True And sPromoteResultsNew4 <> True And spromoteresultsNew5 <> True _
And spromoterenewresults1 <> True And spromoterenewresults2 <> True And spromoterenewresults3 <> True And spromoterenewresults4 <> True And spromoterenewresults5 <> True Then

MsgBox "All criteria for new or renewal have not been met"
Exit Sub
End If

If spromoteresultsNew1 = True Then
    'sPromoteResult = PromoteSubmissionToPolicySHS(Me.Submission_ID, PolyNum1New, Sym1New, "")
    MsgBox "Promote 1 to policy"
ElseIf spromoteresultsNew2 = True Then
    'sPromoteResult = PromoteSubmissionToPolicySHS(Me.Submission_ID, PolyNum2New, Sym2New, "")
    MsgBox "Promote 2 to policy"
End If


***************** all code
'On Error GoTo Err_btnAcceptReportCrite_Click

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Dim SubmissionNewRenewal As String

Dim Sym1New As String
Dim Sym2New As String
Dim Sym3New As String
Dim Sym4New As String
Dim Sym5New As String

Dim PolyNum1New As String
Dim PolyNum2New As String
Dim PolyNum3New As String
Dim PolyNum4New As String
Dim PolyNum5New As String

Dim BoundPremNew As String
Dim BoundPremNew2 As String
Dim BoundPremNew3 As String
Dim BoundPremNew4 As String
Dim BoundPremNew5 As String

Dim PolyNum1ReNew As String
Dim PolyNum2ReNew As String
Dim PolyNum3ReNew As String
Dim PolyNum4ReNew As String
Dim PolyNum5ReNew As String

Dim BoundPremReNew As String
Dim BoundPremReNew2 As String
Dim BoundPremReNew3 As String
Dim BoundPremReNew4 As String
Dim BoundPremReNew5 As String

Dim Mod1ReNew As String
Dim Mod2ReNew As String
Dim Mod3ReNew As String
Dim Mod4ReNew As String
Dim Mod5ReNew As String

Dim SubmissionStatusNew As String

Dim SubmissionStatusReNew1 As String
Dim SubmissionStatusReNew2 As String
Dim SubmissionStatusReNew3 As String
Dim SubmissionStatusReNew4 As String
Dim SubmissionStatusReNew5 As String

Dim Sym1ReNew As String
Dim Sym2ReNew As String
Dim Sym3ReNew As String
Dim Sym4ReNew As String
Dim Sym5ReNew As String

'Putting together the 3 Strings


'Orignal Full Path for the Hard Coded Submission Link Demo = "http://cvgdev20/myFileDemo?tab=submission&submissionId=215545"
'Original Hard Coded Path for Policy Link Demo = "http://cvgdev20/myFileDemo?tab=policy&policyNumber=1319023"



SubmissionNewRenewal = Nz([Forms]![Frm_Submissions]![Text179], "")
Sym1New = Nz([Forms]![Frm_Submissions]![Text327], "")
Sym2New = Nz([Forms]![Frm_Submissions]![Text328], "")
Sym3New = Nz([Forms]![Frm_Submissions]![Text329], "")
Sym4New = Nz([Forms]![Frm_Submissions]![Text330], "")
Sym5New = Nz([Forms]![Frm_Submissions]![Text331], "")

PolyNum1New = Nz([Forms]![Frm_Submissions]![Text251], "")
PolyNum2New = Nz([Forms]![Frm_Submissions]![Text252], "")
PolyNum3New = Nz([Forms]![Frm_Submissions]![Text253], "")
PolyNum4New = Nz([Forms]![Frm_Submissions]![Text254], "")
PolyNum5New = Nz([Forms]![Frm_Submissions]![Text255], "")

BoundPremNew = Nz([Forms]![Frm_Submissions]![Text244], 0)
BoundPremNew2 = Nz([Forms]![Frm_Submissions]![Text245], 0)
BoundPremNew3 = Nz([Forms]![Frm_Submissions]![Text246], 0)
BoundPremNew4 = Nz([Forms]![Frm_Submissions]![Text247], 0)
BoundPremNew5 = Nz([Forms]![Frm_Submissions]![Text248], 0)


PolyNum1ReNew = Nz([Forms]![Frm_Submissions]![Text427], "")
PolyNum2ReNew = Nz([Forms]![Frm_Submissions]![Text428], "")
PolyNum3ReNew = Nz([Forms]![Frm_Submissions]![Text429], "")
PolyNum4ReNew = Nz([Forms]![Frm_Submissions]![Text430], "")
PolyNum5ReNew = Nz([Forms]![Frm_Submissions]![Text431], "")

SubmissionStatusNew = Nz([Forms]![Frm_Submissions]![Text177], "")

Sym1ReNew = Nz([Forms]![Frm_Submissions]![Text483], "")
Sym2ReNew = Nz([Forms]![Frm_Submissions]![Text484], "")
Sym3ReNew = Nz([Forms]![Frm_Submissions]![Text485], "")
Sym4ReNew = Nz([Forms]![Frm_Submissions]![Text486], "")
Sym5ReNew = Nz([Forms]![Frm_Submissions]![Text487], "")

SubmissionStatusReNew1 = Nz([Forms]![Frm_Submissions]![Combo598], "")
SubmissionStatusReNew2 = Nz([Forms]![Frm_Submissions]![Combo599], "")
SubmissionStatusReNew3 = Nz([Forms]![Frm_Submissions]![Combo601], "")
SubmissionStatusReNew4 = Nz([Forms]![Frm_Submissions]![Combo602], "")
SubmissionStatusReNew5 = Nz([Forms]![Frm_Submissions]![Combo603], "")

BoundPremReNew = Nz([Forms]![Frm_Submissions]![Text420], 0)
BoundPremReNew2 = Nz([Forms]![Frm_Submissions]![Text421], 0)
BoundPremReNew3 = Nz([Forms]![Frm_Submissions]![Text422], 0)
BoundPremReNew4 = Nz([Forms]![Frm_Submissions]![Text423], 0)
BoundPremReNew5 = Nz([Forms]![Frm_Submissions]![Text424], 0)

Mod1ReNew = Nz([Forms]![Frm_Submissions]![Text1], "")
Mod2ReNew = Nz([Forms]![Frm_Submissions]![Text2], "")
Mod3ReNew = Nz([Forms]![Frm_Submissions]![Text3], "")
Mod4ReNew = Nz([Forms]![Frm_Submissions]![Text4], "")
Mod5ReNew = Nz([Forms]![Frm_Submissions]![Text445], "")

   Dim sPromoteResult As String
   Dim sPromoteResultNew1 As String
   Dim sPromoteResultNew2 As String
   Dim sPromoteResultNew3 As String
   Dim sPromoteResultNew4 As String
   Dim sPromoteResultNew5 As String
   Dim sPromoteResultReNew1 As String
    Dim sPromoteResultReNew2 As String
     Dim sPromoteResultReNew3 As String
      Dim sPromoteResultReNew4 As String
       Dim sPromoteResultReNew5 As String
   
   

   
    'RENEWAL
   
If Sym1ReNew <> "" And SubmissionStatusReNew1 = "Bound" And SubmissionNewRenewal = "Renewal" And BoundPremReNew > 0 Then
           
            'sPromoteResult = PromoteSubmissionToPolicySHS(Me.Submission_ID, PolyNum1ReNew, Sym1ReNew, Mod1ReNew)
sPromoteResultsReNew1 = True
End If

If Sym2ReNew <> "" And SubmissionStatusReNew2 = "Bound" And SubmissionNewRenewal = "Renewal" And BoundPremReNew2 > 0 Then
           
            'sPromoteResult = PromoteSubmissionToPolicySHS(Me.Submission_ID, PolyNum2ReNew, Sym2ReNew, Mod2ReNew)
sPromoteResultsReNew2 = True
End If

If Sym3ReNew <> "" And SubmissionStatusReNew3 = "Bound" And SubmissionNewRenewal = "Renewal" And BoundPremReNew3 > 0 Then
           
            'sPromoteResult = PromoteSubmissionToPolicySHS(Me.Submission_ID, PolyNum3ReNew, Sym3ReNew, Mod3ReNew)
sPromoteResultsReNew3 = True
End If
If Sym4ReNew <> "" And SubmissionStatusReNew4 = "Bound" And SubmissionNewRenewal = "Renewal" And BoundPremReNew4 > 0 Then
           
            'sPromoteResult = PromoteSubmissionToPolicySHS(Me.Submission_ID, PolyNum4ReNew, Sym4ReNew, Mod4ReNew)
sPromoteResultsReNew4 = True
End If
If Sym5ReNew <> "" And SubmissionStatusReNew5 = "Bound" And SubmissionNewRenewal = "Renewal" And BoundPremReNew5 > 0 Then
           
           ' sPromoteResult = PromoteSubmissionToPolicySHS(Me.Submission_ID, PolyNum5ReNew, Sym5ReNew, Mod5ReNew)
sPromoteResultsReNew5 = True
End If

     
   
     
   'NEW BUSINESS
 
    'call promote sub for new
If Sym1New <> "" And SubmissionStatusNew = "Bound" And SubmissionNewRenewal = "New" And BoundPremNew > 0 Then
           
           ' sPromoteResult = PromoteSubmissionToPolicySHS(Me.Submission_ID, PolyNum1New, Sym1New, "")
spromoteresultsNew1 = True
End If

If Sym2New <> "" And SubmissionStatusNew = "Bound" And SubmissionNewRenewal = "New" And BoundPremNew2 > 0 Then
           
            'sPromoteResult = PromoteSubmissionToPolicySHS(Me.Submission_ID, PolyNum2New, Sym2New, "")

spromoteresultsNew2 = True
End If

If Sym3New <> "" And SubmissionStatusNew = "Bound" And SubmissionNewRenewal = "New" And BoundPremNew3 > 0 Then
           'sPromoteResult = PromoteSubmissionToPolicySHS(Me.Submission_ID, PolyNum3New, Sym3New, "")

MsPromoteResultsNew3 = True
End If

If Sym4New <> "" And SubmissionStatusNew = "Bound" And SubmissionNewRenewal = "New" And BoundPremNew4 > 0 Then
           'sPromoteResult = PromoteSubmissionToPolicySHS(Me.Submission_ID, PolyNum4New, Sym4New, "")
sPromoteResultsNew4 = True
End If

If Sym5New <> "" And SubmissionStatusNew = "Bound" And SubmissionNewRenewal = "New" And BoundPremNew5 > 0 Then
            sPromoteResult = PromoteSubmissionToPolicySHS(Me.Submission_ID, PolyNum5New, Sym5New, "")

spromoteresultsNew5 = True

End If
     
'Exit_btnAcceptReportCrite_Click:

If spromoteresultsNew1 <> True And spromoteresultsNew2 <> True And spromoteresultsNew3 <> True And sPromoteResultsNew4 <> True And spromoteresultsNew5 <> True _
And spromoterenewresults1 <> True And spromoterenewresults2 <> True And spromoterenewresults3 <> True And spromoterenewresults4 <> True And spromoterenewresults5 <> True Then
MsgBox "All criteria for new or renewal have not been met"
Exit Sub
End If

If spromoteresultsNew1 = True Then
    'sPromoteResult = PromoteSubmissionToPolicySHS(Me.Submission_ID, PolyNum1New, Sym1New, "")
    MsgBox "Promote 1 to policy"
ElseIf spromoteresultsNew2 = True Then
    'sPromoteResult = PromoteSubmissionToPolicySHS(Me.Submission_ID, PolyNum2New, Sym2New, "")
    MsgBox "Promote 2 to policy"
End If

   
 
'MsgBox "Promote to Policy Complete"

   
'Err_btnAcceptReportCrite_Click:
'If Err.Number <> 2501 Then
     'MsgBox Error$
  'End If
    'MsgBox Error$
    'Resume Exit_btnAcceptReportCrite_Click
Exit Sub
[+][-]01/29/08 10:29 AM, ID: 20770615Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01/29/08 10:51 AM, ID: 20770808Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01/29/08 10:58 AM, ID: 20770876Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]01/29/08 11:03 AM, ID: 20770924Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: Microsoft Access Database, Access Coding/Macros
Tags: Microsoft, Access, 2003, If Statement
Sign Up Now!
Solution Provided By: Arthur_Wood
Participating Experts: 2
Solution Grade: A
 
 
Loading Advertisement...
20091111-EE-VQP-89 / EE_QW_2_20070628