Ok finally I fixed it, the trick was just to change in the second textbox the criteria, instead of having it <"0.4" I just changed it to <"40%" and that allowed me to keep using the Formatpercent function in the first textcode, so this are the final codes:
Thank you all for your answers
first textbox:
Code:
=IIf(IsNull([Forms]![frm20MainStatus]![cmbStation]),"",
IIf(IsNull(DLookUp("[ValidCert]","[Qry-CertStatStatCount]",
"[Estación]='" & [Forms]![frm20MainStatus]![cmbStation] & "'")),"0%",
FormatPercent(Round(DLookUp("[ValidCert]/[GoalTotal]","[Qry-CertStatStatCount]","[Estación]='"
& [Forms]![frm20MainStatus]![cmbStation] & "'"),2),0)))
Second textbox:
Code:
=IIf(IsNull([Forms]![frm20MainStatus]![cmbStation]),"",
IIf([Forms]![frm20MainStatus]![txtPerStat]="100%","OK",
IIf([Forms]![frm20MainStatus]![txtPerStat]<"40%","Attention","Pending")))