Here's something to get you started. You'll have to adapt it to the
specific of you DB which I didn't have access to. (Evidently the court
order to turn over that information was misfiled.) I'm assuming that you
have some way of designating if a person is a plaintif or defendant. If
there are no plaintifs or defendants, the result will be [v. ],
otherwise the result should list out the formal title.
function getCaseTitle(strDocketNumber as String)
strSQL = "SELECT field1, field2, field3 FROM tblParties WHERE type =
'Defendant';"
Set db = currentDb()
'Get defendants
Set rs = CurrentDB.OpenRecordSet(strSQL, dbOpenForwardOnly)
getCaseTitle = ""
While NOT rs.EOF
If flgAddComma = True then
getCaseTitle = getCaseTitle & ", " & rs("fieldName")
else
getCaseTitle = getCaseTitle & rs("fieldName")
end If
flgAddComma = True
rs.MoveNext
Wend
rs.close
'Get plaintifs
strSQL = "SELECT field1, field2, field3 FROM tblParties WHERE type =
'Plaintif';"
Set rs = CurrentDB.OpenRecordSet(strSQL, dbOpenForwardOnly)
fglAddComma = False
getCaseTitle = getCaseTitle & " v. "
While NOT rs.EOF
If flgAddComma = True then
getCaseTitle = getCaseTitle & ", " & rs("fieldName")
else
getCaseTitle = getCaseTitle & rs("fieldName")
end If
flgAddComma = True
rs.MoveNext
Wend
rs.close
Set rs = Nothing
Set db = Nothing
end fucntion
DMainland wrote:
> I am using a simple text box to return a Plaintiff vs. Defendant title
> ("Black vs. White") on a report. I would like to know how I can concatenate
> the fields to
> give me not only the Plaintiff vs. Defendant but would also return a Co
> Plaintiff and a 2nd CoPlaintiff, and a Co Defendant and a 2nd Co Defendant or
> any combination thereof, in the event I have a case including a combination
> of multiple parties. I hope I am making myself clear.
>
> The names of plaintiff, co-plaintiff, 2nd co-plaintiff, defendant,
> co-defendant, and 2nd co-defendant are entered into separate tables joined by
> a common docket number (autonumber).
>
> Any help would be greatly appreciated.
|