473,395 Members | 1,658 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How do you bold a portion of text entered into an unbound text box

Heather Thurber
I am using the following code in Access 2007

Me.strNotes = "" & DateNow & ", " & strPOEmpID & ":" & Space(1) & "" & Me.strPONotes & "" & vbNewLine & Me.strNotes

I want the "" & DateNow & ", " & strPOEmpID & ":" to be bolded when passed into the strNotes field. I've tried changing the text boxes to rich text formatting but have been unable to figure out how to make this work.

The field will have multiple entries added over time and I want date and employee id bolded on each entry.

FYI - I am not able to download a rich text program due to network permissions.
Jul 20 '10 #1
3 18091
Delerna
1,134 Expert 1GB
I don't use 2007 but a serch with google found this piece of sql code for a field to be displayed in an rtf textbox
Expand|Select|Wrap|Line Numbers
  1. =IIf([CompanyName] Is Null, Null, Replace([CompanyName], "ar", "<font color=""red"">ar</font>")) 
  2.  
and this

Expand|Select|Wrap|Line Numbers
  1. =Replace([CompanyName], "ar", "<b>ar</b>")) 
  2.  
Which suggests to me that you just use standard html syntax.


so have you tried this?
Expand|Select|Wrap|Line Numbers
  1. Me.strNotes = "<b>" & DateNow & "</b>, " & strPOEmpID & ":" & Space(1) & "" & Me.strPONotes & "" & vbNewLine & Me.strNotes
  2.  
Jul 21 '10 #2
patjones
931 Expert 512MB
You don't need to download a rich text program. When you create a text box you can use the Property Sheet > Data > Text Format property to set the box to Rich Text. Or in VBA:

Expand|Select|Wrap|Line Numbers
  1. Me.strNotes.TextFormat = acTextFormatHTMLRichText

At that point Delerna's suggestion works very nicely.

Pat
Jul 21 '10 #3
Thanks that worked great! I just didn't realize the HTML was supposed to go into the VBA.
Jul 21 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: N. Graves | last post by:
Hello, Please help me I'm still a newbie. I have an unbound text box on a report that I would like to build a expression to display it on the report. Something like txtboxSearchCriteria = !!...
7
by: Aravind | last post by:
Hi folks. I have 2 forms, frmBorrow and frmHistory frmBorrow has an unbound multi-column combo box (cboMember) and 7 unbound text boxes (MemNo, MemName, MemIC, MemType, CourseFaculty, Borrow,...
2
by: Zlatko Matić | last post by:
Hello. I have the following problem with MS Access/PostgreSQL combination: There is a form in Access that has an unbound text box, used for entering a commentary of a batch of records. There is a...
2
by: hmiller | last post by:
Hope I make my case clear!!! I have a table with two bound date/time fields. I want to be able to use an IF statement and DateDiff to return a text message in an unbound text box. I want to do...
4
by: ravindarjobs | last post by:
Hi friends, i am using .net 2005 but we dont use validation controls. my requirement is that i have to limit user entering only alpha values in "first name" and "last name" fields. the page...
11
by: jwessner | last post by:
I have a form (Form1) which contains basic Project data and a subform listing the personnel assigned to the Project as a continuous form. Selecting a person on that project and clicking on a command...
1
by: MyWaterloo | last post by:
I have an unbound text box on my main form that is used to show the sum totals in my sub form. I also have a field on my main form that has a control source in a table. This bound field needs to...
4
by: sumit kale | last post by:
Hi, Can somebody help me resolve my problem ? I am getting error when calculating total using unbound textfiled in subform. I have a main form called purchase_register_master and a subform...
9
by: sillyr | last post by:
Hi - I have an unbound text box on a form that calculates a value from a bound text box on the same form. Right now the equation I'm using is =Val(NZ())*0.20 but I would like to have it so if...
2
topher23
by: topher23 | last post by:
Disclaimer: I've already come up with a solution for this issue, but I thought I'd post it in the hope that it could help someone else and on the off chance that someone has another solution. I...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.