Hi Experts,
I have a coding here, but it seems every time when I do the search, it only gave me the first message "This is A H Case" but it should be "This is a H Case also a LSA." even both the CPHEATER & NCPLSA are true, it only sees the CPHEATER is true and did not see the NCPLSA is true too, can any one see what I did wrong? I did tried both codings, but the result are the same:
1). If rs!CPHEATER = True And rs!CPDOMVIOL = False And rs!CPMINORMOM = False And rs!NCPLSA = False And stSecurity >= 5 Or rs!CPHEATER = True And rs!CPDOMVIOL = False And rs!CPMINORMOM = False And rs!CPLSA = False And stSecurity >= 5 Then
MsgBox "This is a H Case.", vbInformation
stDocName = "frmCP"
stLinkCriteria = "[CPCASENUM]=" & "'" & Me![FindField] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
If (rs!CPHEATER = True And rs!NCPLSA = True And stSecurity >= 5) Or (rs!CPHEATER = True And rs!CPLSA = True And stSecurity >= 5) Then
MsgBox "Warning, this is a H Case, also a LSA.", vbInformation
stDocName = "frmCP"
stLinkCriteria = "[CPCASENUM]=" & "'" & Me![FindField] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
end if
end if
2). If rs!CPHEATER = True And rs!CPDOMVIOL = False And rs!CPMINORMOM = False And rs!NCPLSA = False And stSecurity >= 5 Or rs!CPHEATER = True And rs!CPDOMVIOL = False And rs!CPMINORMOM = False And rs!CPLSA = False And stSecurity >= 5 Then
MsgBox "This is a H Case.", vbInformation
stDocName = "frmCP"
stLinkCriteria = "[CPCASENUM]=" & "'" & Me![FindField] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
If rs!CPHEATER = True And rs!NCPLSA = True And stSecurity >= 5 Or rs!CPHEATER = True And rs!CPLSA = True And stSecurity >= 5 Then
MsgBox "Warning, this is a H Case, also a LSA.", vbInformation
stDocName = "frmCP"
stLinkCriteria = "[CPCASENUM]=" & "'" & Me![FindField] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
end if
end if
Thanks,
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. This award is based off of nominations by EE users and experts. Multiple MVEs may be awarded each year.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.