A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Format property



 
 
Thread Tools Display Modes
  #1  
Old August 30th, 2006, 10:20 PM posted to microsoft.public.access.forms
mscertified
external usenet poster
 
Posts: 835
Default Format property

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.
  #2  
Old August 30th, 2006, 10:51 PM posted to microsoft.public.access.forms
Barry Gilbert
external usenet poster
 
Posts: 379
Default Format property

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

"mscertified" wrote:

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.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:35 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.