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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top