Format property

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there any way to specify an optional part of the format?

e.g. I want six digit numbers to format as 99.99.99 and I want 8 digit
numbers to format as 99.99.99_99

I looked in Access help and could find no answer.
 
The format property can't do this natively, but you could wrap your control
source in the format function and wrap that in an IIF function. Something
like:

IIF(Len([MyField])=6, Format([MyField],"99.99.99"), Format([MyField],
"99.99.99_99")

This is untested, but it might give you the idea.

Barry
 
Back
Top