dbTalk Databases Forums  

Simply stupid

comp.database.ms-access comp.database.ms-access


Discuss Simply stupid in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Al Fleagle
 
Posts: n/a

Default Simply stupid - 12-09-2003 , 09:06 PM






I know this is probably so basic I'll be awakened by a burning windows XP
logo burning on my lawn tomorrow morning, but here's my question anyway:

I have telephone numbers in a database without dashes between the numbers.
(1234567) How do I put a dash after the first three numbers in a form?
(123-4567)

I tried formatting with ###"-"#### but that gave me some strange results.

Any suggestions?

Thanks.




Reply With Quote
  #2  
Old   
Bradley
 
Posts: n/a

Default Re: Simply stupid - 12-09-2003 , 09:21 PM






"Al Fleagle" <fleagle (AT) seark (DOT) net> wrote

Quote:
I know this is probably so basic I'll be awakened by a burning windows XP
logo burning on my lawn tomorrow morning, but here's my question anyway:

I have telephone numbers in a database without dashes between the numbers.
(1234567) How do I put a dash after the first three numbers in a form?
(123-4567)

I tried formatting with ###"-"#### but that gave me some strange results.

Any suggestions?

Thanks.
If you can't get the format to work perhaps try...

Left([PhoneNumber], 4) & "-" & Right([PhoneNumber], Len([PhoneNumber]) - 4)

Not great, but should work.
--
Bradley
Software Developer www.hrsystems.com.au
A Christian Response www.pastornet.net.au/response




Reply With Quote
  #3  
Old   
Scott McDaniel
 
Posts: n/a

Default Re: Simply stupid - 12-10-2003 , 05:58 AM



Set the INPUT MASK of your control to this:

!(999) 000-0000;;_

Which will result in this:

(123) 456-7890

Your data will still be stored as:

1234567890

Alternatively, you can click on the InputMask property in the properties
dialog, click the Build button, and a wizard will build this for you ...
--
Scott McDaniel
CS Computer Software
Visual Basic - Access - Sql Server - ASP
"Al Fleagle" <fleagle (AT) seark (DOT) net> wrote

Quote:
I know this is probably so basic I'll be awakened by a burning windows XP
logo burning on my lawn tomorrow morning, but here's my question anyway:

I have telephone numbers in a database without dashes between the numbers.
(1234567) How do I put a dash after the first three numbers in a form?
(123-4567)

I tried formatting with ###"-"#### but that gave me some strange results.

Any suggestions?

Thanks.






Reply With Quote
Reply




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 On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.