I need to format zip codes in a form as either 5 characters or 9 characters with a dash. The data in the field do not contain dashes. I have tried the following code in the unbound control source of the form, but neither work.
=IIf(Len([Zip])>=6, Left([Zip],5) & "-" & Right([Zip],4),[Zip])
=IIF(Len(zip)=6, Left(zip,5),IIF(Len(zip)=9,Format(Zip,"@@@@@-@@@@"),Zip))