Hi TorLang
DBlank is completely right it's all about nulls & how your database handles them & even back to how the data gets there.
Imagine this scenario:
User entering client name uses mouse to move from first name field to surname field - thus the middle initial will be null as the user never "activated" this field.
User entering client name uses tab to go from first name to middle initial to surname - since the middle initial field has been activated, it is no longer null, but will be empty. The same thing would happen, if they clicked into the middle inital field, but didn't enter anything. The database then sees that field as existing.
That's why your first formula worked for names even if they didn't have a middle intial - as the field wasn't null.
You can allow for this scenario (eg middle initial field exists, but contains no data).
if (isnull ({TSM040_PERSON_HDR_patient.mid_nm}) or totext({TSM040_PERSON_HDR_patient.mid_nm})="")
then
{TSM040_PERSON_HDR_patient.lst_nm} & ", " & {TSM040_PERSON_HDR_patient.fst_nm} else
{TSM040_PERSON_HDR_patient.lst_nm} & ", " & {TSM040_PERSON_HDR_patient.fst_nm} & " " & {TSM040_PERSON_HDR_patient.mid_nm}