Link to home
Start Free TrialLog in
Avatar of Benny_Floden
Benny_FlodenFlag for Belgium

asked on

Access rich text field automatically underlines telephone numbers

We have started using rich text fields in our Access application.
Our customers have noticed that when they type tel:xxxxx in any of these boxes, it becomes a hyperlink (blue and underlined).
I can reproduce it on my computer.
All autocorrect features are turned off.  Each field is set to autocorrect FALSE.  The fields are not hyperlink fields.
If you type a long text and in the middle insert tel:xxxxx, only that part is underlined.
I have tried to turn off the autoformat options in Word in case Access is using the same settings.  I cannot find any options for autoformat in Access.
Does anyone have an idea where to look?  I cannot find any information that concerns this.

Best regards
Benny Floden, RCC INT
Avatar of Jeffrey Coachman
Jeffrey Coachman
Flag of United States of America image

How are us specifying that this is designated for phone numbers only?

Short text field data types can allow for an "Input Mask" property to be set for phone number values,
So typing this:
6312345678
will result in:
(631) 234-5678
...being displayed in the field automaitically


...but this does not apply for Long/Rich text.

Is this issue in a form, or in the table, ... (or both)?
If the issue is in a form, ..make sure the "IsHyperlink" property of the Phone number field/control is set to NO.

Finally, ...why is this field set as Rich Text?

JeffCoachman
Note that even if the field is NOT set as a "Hyperlink" explicitly, ...it will still look like a hyperlink in the form if the IsHyperlink Property is set to TRUE/ON.
<If you type a long text and in the middle insert tel:xxxxx, only that part is underlined.>
...Not sure what this means, ...but investigate my points above and let me know...
Avatar of Benny_Floden

ASKER

Hi Jeffrey
Thanks for taking the time to look at this.
Just to clarify; this is NOT a phone number field. It is a general text field where user can write anything.  No hyperlink property is turned on anywere.

Easy to reproduce.
Create test table with a memo field.  Only change text format to rich text.  All else stays default.
Create test form with a text box where you enable Rich text bound to the test table.
Type tel:444 into the box and see.  Type anything else before or after and see that all else is normal.
I have attached a file with a picture of a text box where you can see the issue.
Best regards
Benny
Rich-text-issue.jpg
Forgot to say that this also happens when you type directly into the table so it is not linked with any setting in the form
I see what you mean.

This is an issue built into CSS/HTML
See here for more info:
https://css-tricks.com/the-current-state-of-telephone-links/
...I don' see an easy way to get around this.

Possible workarounds:
1. Try using:
        ph:
...instead

2. Don't use rich text for this field. (still not sure of the need for HTML formatting for a phone number...?)
Again, ...if you changed the datatype to short text, ...you could apply a Phone number input mask.
This way a user would only need to type:
6312345678
...and it would be displayed as: (631)234-5678
...automatically.

Another question would be why are the users typing "tel:" ?
Can a phone number go into any (rich text) field? If so, ...why?
This seems to violate the basic database rule of non-repeating data.

This would be like having a field named "Country", ...then for every entry into that field,...you type:
Country:USA
Country:Spain
Country:Mexico
Country:France
Country:Germany
Country:Mexico
Country:Mexico
Country:Spain
Country:USA
Country:USA
Country:USA
Country:Germany

Here, the string "Country:" is repeating.
Since the name of the field is "Country", ...pre-pending "Country:" to every value, is redundant

The other issue here is that this creates two pieces of data in the field
"tel:"
...and ...
"631-267-9824"

This means that you cannot make a simple query of all the records in Germany:
SELECT ID, Country
FROM YourTable
WHERE Country="Germany"

In your case, you would be forced to do something like this:
SELECT ID, Country
FROM YourTable
WHERE Country="Countyry:Germany"
(or creating a way to strip out the string "Country:")


If, ...on the other hand, ...you have many different designations:
tel:
office:
cellular:
home:
Then perhaps these would be better as separate fields (or better yet, ...normalized out into a related "ContactMethod" table.)

Also, 'Rich Text" is an MS Access only construct, ..and the formatting will not be available when you upgrade to SQL Server, Oracle, or MySQL.

Finally (In MS Access) Rich Text is really HTML.
True "Rich Text"(RTF) is very different form HTML
For example, ...this is the actual data for my name in Bold in RTF
{\rtf1\ansi{\fonttbl\f0\fswiss Helvetica;}\f0\pard JeffCoachman {\b bold} text.\par}
...here is the same thing in HTML
<b>JeffCoachman</b>


Hope all this clears things up a bit.

JeffCoachman
Hi Jeff
You are making very complete remarks.  I appreciate it.
Our software is a big erp system for international trade.  It is fully normalized and we do, of course, have phone numbers (and all other fields) separated in their own fields.
Sometimes a user needs to add additional information to some documents.
It can for instance be:
"When truck arrives at loading place, please call Mr. X on tel:555-254-2541 to open gate."

Thank you for pointing out that tel: is a prefix such as ftp, email and so forth.
What I still do NOT understand, is why ONLY "tel:" behaves this way in these fields.  If I enter an ftp address or email address or html address, the text will NOT automatically turn into a hyperlink.  I have turned off these auto format options in Office.
There are no options inside Access itself to turn off auto formatting so I am guessing it is looking at the Office choices.
Any ideas?
You are making very complete remarks.  I appreciate it.
Thanks, ...you are also providing clear explanations, so that helps me understand as well.
;-)
...so hopefully we can get you to a solution.

"When truck arrives at loading place, please call Mr. X on tel:555-254-2541 to open gate.
OK, ...I see, ...
Again, ...try:
   ph.:
... or perhaps:
   tel.:
...or perhaps leave it as is, and simply ignore the underlining?

What I still do NOT understand, is why ONLY "tel:" behaves this way in these fields.
In the link I posted, ...it states that this was a decision that was made years ago, ...
I saw no easy way to workaround this behavior.

Can you tell me why this field needs to be rich text (HTML)?
You can leave it as Long Text/Memo, ...just do not add the Rich Text formatting.

JeffCoachman
If the ultimate question is "why", ...then the answer is because that is the way it was designed:
https://css-tricks.com/the-current-state-of-telephone-links/

If the ultimate question is "How do I workarond it, ...I proposed:
Again, ...try:
   ph.:
... or perhaps:
   tel.:
...or perhaps leave it as is, and simply ignore the underlining?

...or simply avoid using Rich text...

JeffCoachman
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.