Wow. Thank you!
Dim strCert As String
Dim dteMOCCertDate As Date
Dim blnCert As Boolean
Dim strMOCExpire As String
Dim strMOCField As String
Dim blnInactive As Boolean
Dim blnActive As Boolean
Dim strSQL As String
Dim rstName As Recordset
Dim rstTemp As Recordset
Dim blnChangeDOB As Boolean
Dim i As Integer
txtCert = ""
strCert = ""
i = 0
blnCert = False
strCert = strCert '+ vbCrLf
If rstTemp![AppStatus] = "Active" Then
If blnCert = True Then
If InStr(1, rstTemp!FieldCode, "M") > 0 Then
strMOCField = rstTemp!CertifName
dteMOCCertDate = rstTemp!AppStatusDate
strMOCExpire = CStr(rstTemp!ExpireYear)
blnChangeDOB = True
Else
strCert = strCert + "In the examination process in " + rstTemp!CertifName
txtCert = strCert
End If
Else
If rstTemp!FieldCode = "PA" Then
Else
If (InStr(1, rstTemp!FieldCode, "M") = 0 And InStr(1, rstTemp!FieldCode, "Z") = 0) Then
strCert = strCert + "In the examination process in " + rstTemp!CertifName
strCert = strCert + vbCrLf
txtCert = strCert
blnActive = True
Else
blnChangeDOB = True
End If
End If
End If
ElseIf rstTemp![AppStatus] = "Certified" Then
blnCert = True
i = i + 1
strCert = strCert + vbCrLf + "Certified: "
If rstTemp!FieldCode = "DS" Then
strCert = strCert + rstTemp!CertifNameFormal & ", " & DatePart("yyyy", rstTemp![AppStatusDate])
Else
strCert = strCert + rstTemp![CertifName] & ", " & DatePart("yyyy", rstTemp![AppStatusDate])
End If
If Not IsNull(rstTemp![ExpireYear]) Then
strCert = strCert & vbCrLf & Space(16) & "Maintenance of Certification: " _
& DatePart("yyyy", rstTemp![AppStatusDate]) & " - " & rstTemp![MOCExpireYear]
strCert = strCert & " - valid through 12/31/" & rstTemp![ExpireYear] & vbCrLf
dteMOCCertDate = rstTemp!AppStatusDate
Else
strCert = strCert + ", Lifetime"
strCert = strCert + vbCrLf
End If
ElseIf rstTemp!AppStatus = "Inactive" Then
blnInactive = True
End If