Solved

Access TextBox Bold Function

Posted on 2008-06-10
17
2,047 Views
Last Modified: 2013-11-28
Hi Expert,

I have a quick question.
I am seeking a function that can change words into bold format in a textbox.

for example,
="Today Date is " & Boldfunction(Date()) & "."

the output will be "Today Date is <b>06/10/2008</b>.

Thanks!
0
Comment
Question by:IEHP1
  • 7
  • 4
  • 3
  • +1
17 Comments
 
LVL 77

Expert Comment

by:peter57r
ID: 21752647
Function Bdate(mydate As Date)
Bdate = "<b>" & Format(mydate, "mm/dd/yyyy") & "</b>"
End Function
0
 

Author Comment

by:IEHP1
ID: 21753151
nope...

it does not work....
the <b> and </b> are just something like the html..
however, it does not work with access...
i put them there to make sure you understand the date will be bold.

Thanks!
0
 
LVL 77

Expert Comment

by:peter57r
ID: 21753906
That's not what I understood.  I thought you wanted to produce the html.

If you are trying to create a string which is actually  partly (or even ALL)  bold then you are out of luck in Access.
Variables and expressions have no formatting capability.  Formatting of that type is down to controls on forms and reports and their properties.  
There is no native Access control before A2007 which allows for mixed formats in a textbox, although there are third party rtf controls around.  





0
 
LVL 28

Expert Comment

by:omgang
ID: 21753931
To do what you are asking will require two text boxes with no coding.  In Access forms/reports formatting applies to all text within the text box, i.e. you cannot bold only a portion of the text.  A solution is to use two text boxes.  The first contains ="Today Date is " as its control source and is right justified.  The second text box is adjacent to the first (right side) and has =Date() as its control source.  Set the Font Weight property to whatever you want (Bold) for this text box.

OM Gang
0
 

Author Comment

by:IEHP1
ID: 21754134
Peter57r: I just want to make sure. As you mentioned, it is not possible to write a function to do what i want?

OM Gang: Thanks! However, i am doing both Spanish and English version in the same report, the length of the test will not be the same. I cannot do two text boxes.

0
 
LVL 28

Expert Comment

by:omgang
ID: 21754288
That is why I said
<<The first contains ="Today Date is " as its control source and is right justified.>>

By making the text box right justified it doesn't matter how long the text is in the box.  It will always display as you want, i.e
        Today Date is |6/10/2008
      Hoy es la fecha|6/10/2008

OM Gang
0
 

Author Comment

by:IEHP1
ID: 21754503
OM Gang,

Actually, i made my question simplier to understand.

part of paragraph is
"Please return the enclosed application to qualify your child(ren) for up to one more year of health coverage by 06/30/2008"

and ths spanish version is
"Es hora de renovar el seguro médico Niños Saludables (Healthy Kids) de su(s) hijo(s). Por favor devuelva la solicitud adjunta para que su(s) hijo(s) tenga(n) acceso a un año más de cobertura médica de 06/30/2008"

the length of the whole paragraph in spanish and english are way different.
there is no way to do the adjustment using two textboxes.

0
 

Author Comment

by:IEHP1
ID: 21754529
sorry the spanish version is
"Por favor devuelva la solicitud adjunta para que su(s) hijo(s) tenga(n) acceso a un año más de cobertura médica de 06/30/2008"
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 28

Accepted Solution

by:
omgang earned 50 total points
ID: 21754587
Understood.  If you really want to have the date in bold then you're going to have to come up with a work around that allows you to use two text boxes, i.e.

"Please return the enclosed application to qualify your child(ren)
 for up to one more year of health coverage by the date specified."           <b>06/30/2008</b>

OM Gang
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 21756456
IEHP1,

Go here and download the Rich Text Tool:
http://www.lebans.com/DownloadFiles/May23-2004OCXonly.zip
Install it.
Open Access.
Create a from.
Click: Insert ActiveX Control.
Find: RTF2 Control.
Drop 3 of them on your form, and re-size them so they will fit your text.
Insert these 3 text strings into the ControlSource Property of each RTF2 Control.

="{\rtf1\ansi{\fonttbl\f0\fswiss Helvetica;}\f0\pard Es hora de renovar el seguro médico Niños Saludables (Healthy Kids) de su(s) hijo(s). Por favor devuelva la solicitud adjunta para que su(s) hijo(s) tenga(n) acceso a un año más de cobertura médica de {\b 06/30/2008.}\par}"

="{\rtf1\ansi{\fonttbl\f0\fswiss Helvetica;}\f0\pard Please return the enclosed application to qualify your child(ren) for up to one more year of health coverage by {\b 06/30/2008.}\par}"

="{\rtf1\ansi{\fonttbl\f0\fswiss Helvetica;}\f0\pard Por favor devuelva la solicitud adjunta para que su(s) hijo(s) tenga(n) acceso a un año más de cobertura médica de {\b 06/30/2008.}\par}"

I tried it and it works fine for me.
This should get you what you are looking for.

JeffCoachman
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 21757023
IEHP1,

In my above post I am using a Form.
But you can substitute a Report as well.

Do the above as a simple test to see if this is the effect you are after.

I can help you if any of the text needs to come from a table.

JeffCoachman
0
 

Author Comment

by:IEHP1
ID: 21764758
Hi Jeff

May i know if i have to install the Rich Text Tool on every computer that may run the report?

Thanks~
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 21764918
Yes
0
 

Author Comment

by:IEHP1
ID: 21771722
because everyone in the company may run the report, is there anyway to do it within the database, but not every computers?

Thanks!
0
 
LVL 74

Assisted Solution

by:Jeffrey Coachman
Jeffrey Coachman earned 50 total points
ID: 21772855
IEHP1,

First, my assumption was that your DB is split.
(Font end DB on each users computer with Forms Queries and reports , and one Back end table with just the shared tables)

So AFAIK you have to literally "Install" it on each computer that needs it.

But just to be sure, see this as well:
http://www.lebans.com/richtext.htm#Older%20NON%20ActiveX%20solutions:


FMSinc also has a Rich Text control (Total Access Memo).
You will have to send them an email to see if the control can be "Database Specific"
http://www.fmsinc.com/products/memo/whydevelopers.html

JeffCoachman
0
 
LVL 77

Assisted Solution

by:peter57r
peter57r earned 50 total points
ID: 21776324
Any ocx or simlar used in the database must be installed on every user's machine.
0
 

Author Closing Comment

by:IEHP1
ID: 31465790
It is not the solution that i want.
I split the report into two - one english and one spanish.
So i dont have to worry about the length before the date.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now