Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2679
  • Last Modified:

Access TextBox Bold Function

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
IEHP1
Asked:
IEHP1
  • 7
  • 4
  • 3
  • +1
3 Solutions
 
peter57rCommented:
Function Bdate(mydate As Date)
Bdate = "<b>" & Format(mydate, "mm/dd/yyyy") & "</b>"
End Function
0
 
IEHP1Author Commented:
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
 
peter57rCommented:
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
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
omgangCommented:
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
 
IEHP1Author Commented:
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
 
omgangCommented:
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
 
IEHP1Author Commented:
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
 
IEHP1Author Commented:
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
 
omgangCommented:
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
 
Jeffrey CoachmanMIS LiasonCommented:
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
 
Jeffrey CoachmanMIS LiasonCommented:
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
 
IEHP1Author Commented:
Hi Jeff

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

Thanks~
0
 
Jeffrey CoachmanMIS LiasonCommented:
Yes
0
 
IEHP1Author Commented:
because everyone in the company may run the report, is there anyway to do it within the database, but not every computers?

Thanks!
0
 
Jeffrey CoachmanMIS LiasonCommented:
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
 
peter57rCommented:
Any ocx or simlar used in the database must be installed on every user's machine.
0
 
IEHP1Author Commented:
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

Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

  • 7
  • 4
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now