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 » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How do I parse a phone number?



 
 
Thread Tools Display Modes
  #1  
Old May 4th, 2010, 08:13 PM posted to microsoft.public.access.reports
gagecres
external usenet poster
 
Posts: 36
Default How do I parse a phone number?

I have a report where I use a text box to enter a phone number that the user
has entered on the main form. Currently, I have my verbiage with the phone
number text box right next to it. For example, "I can be reached at:" [Phone
Number]. When I do this the phone number is in the format I would expect,
(123)456-7890. I made a change to the line so that the entire line is in the
same text box. For example, ="discuss this further, I can be reached at: " &
[Investor Phone] & "." When I do this the phone number appears like so,
1234567890. Is there a way I can enter this line into the text box so that
the phone number has the parenthesis and dash , i.e. (123)456-7890?
  #2  
Old May 4th, 2010, 08:56 PM posted to microsoft.public.access.reports
Petr Danes[_3_]
external usenet poster
 
Posts: 52
Default How do I parse a phone number?

If you always have all ten digits, something like this might work:

="discuss this further, I can be reached at: " & Format$([Investor
Phone],"(###)###-####")

Pete


"gagecres" pÃ*Å¡e v diskusnÃ*m pÅ™Ã*spÄ›vku
...
I have a report where I use a text box to enter a phone number that the
user
has entered on the main form. Currently, I have my verbiage with the
phone
number text box right next to it. For example, "I can be reached at:"
[Phone
Number]. When I do this the phone number is in the format I would expect,
(123)456-7890. I made a change to the line so that the entire line is in
the
same text box. For example, ="discuss this further, I can be reached at:
" &
[Investor Phone] & "." When I do this the phone number appears like so,
1234567890. Is there a way I can enter this line into the text box so
that
the phone number has the parenthesis and dash , i.e. (123)456-7890?


  #3  
Old May 4th, 2010, 10:47 PM posted to microsoft.public.access.reports
gagecres
external usenet poster
 
Posts: 36
Default How do I parse a phone number?

I keep getting a syntax error.

"Petr Danes" wrote:

If you always have all ten digits, something like this might work:

="discuss this further, I can be reached at: " & Format$([Investor
Phone],"(###)###-####")

Pete


"gagecres" pÃ*Å¡e v diskusnÃ*m pÅ™Ã*spÄ›vku
...
I have a report where I use a text box to enter a phone number that the
user
has entered on the main form. Currently, I have my verbiage with the
phone
number text box right next to it. For example, "I can be reached at:"
[Phone
Number]. When I do this the phone number is in the format I would expect,
(123)456-7890. I made a change to the line so that the entire line is in
the
same text box. For example, ="discuss this further, I can be reached at:
" &
[Investor Phone] & "." When I do this the phone number appears like so,
1234567890. Is there a way I can enter this line into the text box so
that
the phone number has the parenthesis and dash , i.e. (123)456-7890?


.

  #4  
Old May 5th, 2010, 12:03 AM posted to microsoft.public.access.reports
Marshall Barton
external usenet poster
 
Posts: 5,361
Default How do I parse a phone number?

gagecres wrote:

I have a report where I use a text box to enter a phone number that the user
has entered on the main form. Currently, I have my verbiage with the phone
number text box right next to it. For example, "I can be reached at:" [Phone
Number]. When I do this the phone number is in the format I would expect,
(123)456-7890. I made a change to the line so that the entire line is in the
same text box. For example, ="discuss this further, I can be reached at: " &
[Investor Phone] & "." When I do this the phone number appears like so,
1234567890. Is there a way I can enter this line into the text box so that
the phone number has the parenthesis and dash , i.e. (123)456-7890?



Assuming the phone number field in the table is a Text
field:

="discuss this further, I can be reached at: " &
Format([Investor Phone], "=\(@@@\)@@@\-@@@@") & "."

--
Marsh
MVP [MS Access]
  #5  
Old May 5th, 2010, 12:14 AM posted to microsoft.public.access.reports
fredg
external usenet poster
 
Posts: 4,386
Default How do I parse a phone number?

On Tue, 4 May 2010 14:47:01 -0700, gagecres wrote:

I keep getting a syntax error.

"Petr Danes" wrote:

If you always have all ten digits, something like this might work:

="discuss this further, I can be reached at: " & Format$([Investor
Phone],"(###)###-####")

Pete

"gagecres" pí¹e v diskusním pøíspìvku
...
I have a report where I use a text box to enter a phone number that the
user
has entered on the main form. Currently, I have my verbiage with the
phone
number text box right next to it. For example, "I can be reached at:"
[Phone
Number]. When I do this the phone number is in the format I would expect,
(123)456-7890. I made a change to the line so that the entire line is in
the
same text box. For example, ="discuss this further, I can be reached at:
" &
[Investor Phone] & "." When I do this the phone number appears like so,
1234567890. Is there a way I can enter this line into the text box so
that
the phone number has the parenthesis and dash , i.e. (123)456-7890?


.


Did you check for improper word wrap?
You'll have to post your exact expression by copying it and pasting it
into a reply message..
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
  #6  
Old May 5th, 2010, 12:18 AM posted to microsoft.public.access.reports
Petr Danes[_3_]
external usenet poster
 
Posts: 52
Default How do I parse a phone number?

I gave it in the form you would use it in VBA code. If you're using the
expressions in a query, form or report, use it without the dollar sign. Also
try with a semicolon instead of a comma.

Pete


"gagecres" pÃ*Å¡e v diskusnÃ*m pÅ™Ã*spÄ›vku
...
I keep getting a syntax error.

"Petr Danes" wrote:

If you always have all ten digits, something like this might work:

="discuss this further, I can be reached at: " & Format$([Investor
Phone],"(###)###-####")

Pete


"gagecres" pÃ*Å¡e v diskusnÃ*m
pÅ™Ã*spÄ›vku
...
I have a report where I use a text box to enter a phone number that the
user
has entered on the main form. Currently, I have my verbiage with the
phone
number text box right next to it. For example, "I can be reached at:"
[Phone
Number]. When I do this the phone number is in the format I would
expect,
(123)456-7890. I made a change to the line so that the entire line is
in
the
same text box. For example, ="discuss this further, I can be reached
at:
" &
[Investor Phone] & "." When I do this the phone number appears like
so,
1234567890. Is there a way I can enter this line into the text box so
that
the phone number has the parenthesis and dash , i.e. (123)456-7890?


.


  #7  
Old May 5th, 2010, 12:44 AM posted to microsoft.public.access.reports
Petr Danes[_3_]
external usenet poster
 
Posts: 52
Default How do I parse a phone number?

And another 'brute force' method:

="discuss this further, I can be reached at: (" & left([Investor Phone];3) &
")" & mid([Investor Phone];4;3) & "-" & right([Investor Phone];4)

Pete



"gagecres" pÃ*Å¡e v diskusnÃ*m pÅ™Ã*spÄ›vku
...
I keep getting a syntax error.

"Petr Danes" wrote:

If you always have all ten digits, something like this might work:

="discuss this further, I can be reached at: " & Format$([Investor
Phone],"(###)###-####")

Pete


"gagecres" pÃ*Å¡e v diskusnÃ*m
pÅ™Ã*spÄ›vku
...
I have a report where I use a text box to enter a phone number that the
user
has entered on the main form. Currently, I have my verbiage with the
phone
number text box right next to it. For example, "I can be reached at:"
[Phone
Number]. When I do this the phone number is in the format I would
expect,
(123)456-7890. I made a change to the line so that the entire line is
in
the
same text box. For example, ="discuss this further, I can be reached
at:
" &
[Investor Phone] & "." When I do this the phone number appears like
so,
1234567890. Is there a way I can enter this line into the text box so
that
the phone number has the parenthesis and dash , i.e. (123)456-7890?


.


 




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 02:42 PM.


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