I have two pieces of code
="GROUP ESCORT:" & " " & CHR(10) &
IIf(First(Fields!leader_lname.Value, "DataSet1") = First(Fields!grp_escort_name.Value, "DataSet1"),
First(Fields!grp_escort_name.Value, "DataSet1"),
(First(Fields!grp_escort_name.Value, "DataSet1") & " " & CHR(10) & IIF((IsNothing(First(Fields!grp_escort_email.Value, "DataSet1"))),
First(Fields!grp_escort_phone.Value, "DataSet1"),
((First(Fields!grp_escort_email.Value, "DataSet1")) & " " & CHR(10) & First(Fields!grp_escort_phone.Value, "DataSet1")))))
a very complex nested statement that says - if leader name is the same as escort name then simply print the escort name otherwise print the escort name, and then evaluate if email is empty print phone only -- if email isn't empty print email and phone, etc.
Now I had put together a piece of code (with the help of other codes on stack overflow to evaluate and format the phone number.
both peices of code work great independently but I've tried combinging and can't get them to work together.
IIF(First(Fields!grp_escort_phone.Value, "DataSet1") Is Nothing, Nothing,
IIF(IsNumeric(First(Fields!grp_escort_phone.Value, "DataSet1")),
Format(Val(First(Fields!grp_escort_phone.Value, "DataSet1")), "(###) ###-####"),
First(Fields!grp_escort_phone.Value, "DataSet1")))
I would like the top logic to remain but the phone number if printed to be replaced by the formatted piece.
Aucun commentaire:
Enregistrer un commentaire