473,379 Members | 1,260 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,379 software developers and data experts.

Changing font size for one part of a text box

1
I have a text box in a report that shows the name and job title of the employee issuing the report,as follows

"Per: " & [Employees.Name] & " / " & [Title]

The text box is set to be an 11 point font but I want the [Title] to be a 9 point font. How can I do that?
Jul 16 '19 #1

✓ answered by ADezii

  1. I was passing by as I sometimes often do, and I noticed this Thread as well as my old pal NeoPa. To answer your question, you can change Font Sizes for different elements of a String within a Text Box (Rich) by using the outdated <Font> HTML Tag. Here is how it can be done:
  2. Create an Unbound Text Box on your Report and set it's Text Format Property = Rich Text.
  3. Using HTML Font Tags as well as Field Descriptors, set the Control Source Property of this Unbound Text Box to something along the lines of:
    Expand|Select|Wrap|Line Numbers
    1. ="<font size=2>" & [Employee Name] & "</font>" & " | " & "<font size=3 color=red>" & [Job Title] & "</font>"
  4. The above Control Source will set the Font Size of the [Employee Name] Field = 2 and the Font Size of the following [Job Title] Field = 3 (Default). When setting the Font Size using this approach, the options for Font Size, as far as I know are 1 thru 7.
  5. The [Job Title] Field will also be in Red for illustration purposes only.
  6. Enough rambling on, I am Uploading an Attachment based partially on the Employees Address Book Report of the Northwind Sample DB which should make matters much clearer.
  7. Good Luck with your Project!

5 3558
NeoPa
32,556 Expert Mod 16PB
I believe newer versions of Access have RTF controls that allow formatting within the control itself.
Jul 17 '19 #2
ADezii
8,834 Expert 8TB
  1. I was passing by as I sometimes often do, and I noticed this Thread as well as my old pal NeoPa. To answer your question, you can change Font Sizes for different elements of a String within a Text Box (Rich) by using the outdated <Font> HTML Tag. Here is how it can be done:
  2. Create an Unbound Text Box on your Report and set it's Text Format Property = Rich Text.
  3. Using HTML Font Tags as well as Field Descriptors, set the Control Source Property of this Unbound Text Box to something along the lines of:
    Expand|Select|Wrap|Line Numbers
    1. ="<font size=2>" & [Employee Name] & "</font>" & " | " & "<font size=3 color=red>" & [Job Title] & "</font>"
  4. The above Control Source will set the Font Size of the [Employee Name] Field = 2 and the Font Size of the following [Job Title] Field = 3 (Default). When setting the Font Size using this approach, the options for Font Size, as far as I know are 1 thru 7.
  5. The [Job Title] Field will also be in Red for illustration purposes only.
  6. Enough rambling on, I am Uploading an Attachment based partially on the Employees Address Book Report of the Northwind Sample DB which should make matters much clearer.
  7. Good Luck with your Project!
Attached Files
File Type: zip Font Demo.zip (36.7 KB, 124 views)
Jul 18 '19 #3
NeoPa
32,556 Expert Mod 16PB
Looks like you got lucky. My good old buddy ADezii popped in to answer your question :-)
Much fuller answer than my basic one.
Jul 18 '19 #4
ADezii
8,834 Expert 8TB
One out of two is a great batting percentage, but not very good for answering questions in this Forum! (LOL).
Jul 18 '19 #5
NeoPa
32,556 Expert Mod 16PB
It's much better than that ADezii. One small slip doesn't tell any part of the whole story.

NB. For others reading this it refers to a separate thread (How to create a hyperlink?).
Jul 18 '19 #6

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

Similar topics

4
by: M P | last post by:
Is there a way that I can reduce the size of the font on the <select> html tag? The reason is I have a data that have almost 100+ characters. Hope you might help!
5
by: dixie | last post by:
I want to be able to set the font size and font type for text in a text box on a report using VBA. I wan't to be able to control it from a setting in a table. The problem is that I don't know the...
5
by: Jonesgj | last post by:
Hi all, Simple one I'm sure... How can I change the size of font used in textbox at runtime? Jonesgj
1
by: Kasey | last post by:
How do you change the row height in a data grid - I do not want to increase the height by changing my font size. My product is a touch screen so I have to make the row height large enought for a...
18
by: Diogenes | last post by:
Hi All; I, like others, have been frustrated with designing forms that look and flow the same in both IE and Firefox. They simply did not scale the same. I have discovered, to my chagrin,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.