?
Solved

changing font color in MS Access 2010 expression

Posted on 2012-12-28
4
Medium Priority
?
2,101 Views
Last Modified: 2013-01-04
I am working in an access 2010 database and have a memo field that is set to rich text.  I would like to select all text in this field and change the font color.  It is too time consuming to select the text in each row and change the formating.  I was wondering if I could do this in an expression on a qry where I am combining two fields [sub question] & [answer].  I would like the "answer' to appear in red.  Or could I do this in the SQL view?  Thank you for your help.

Joanne
0
Comment
Question by:joanne2468
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 29

Expert Comment

by:IrogSinta
ID: 38728747
Can you describe this a bit more? I don't quite understand what you're trying to achieve. If you can post a screenshot, that may make it clearer.
0
 

Author Comment

by:joanne2468
ID: 38729336
I have a MS database that has two tables.  One table has questions and answers from a questionnaire and one table has an action plan.

I have the [question], [subquestion] & [answer] fields set as memo fields in table1.  I have the [action] field and [comment] field in table2 set to memo also.  Both of these tables were imported to the database from Excel.  I have a query where I have expressions that combine the [question] & [answer] fields and another expression that combines the [action] & [comment] fields.  

Since you can set memo fields to rich text it allows you to select (one word or multiple words) in a field and change the font color, size, etc. and it will only do this in the one field on the text selected. If I change this at the table level it will have that change in the report. So in my report the question field is black and the answer is in blue (to help with reading)

My question is can I select all of the text in the field and change all of the font color for only that field at the table level  OR can I do this when I build the expression in the query?  

For example my expression is:

=[subquestion] &": "& [answer]]

is there a way I can put some type of vb code before [answer] that will change the font to blue?  Or could I put this in the SQL view of the query?

I am at home and don't have access to the database to where I could provide a screenshot.  Any help you can provide would be appreciated.  

Joanne
0
 
LVL 29

Accepted Solution

by:
IrogSinta earned 2000 total points
ID: 38729393
You don't really need to set all your fields to memo data type for this.  Memo is needed if a field needs to store more than 255 characters or if you were actually storing formatting tags to be used in a RichTextbox.

In your case, since you are using an unbound textbox, set its TextFormat property to RichText and use this expression that includes formatting tags:
=[subquestion] & ": <font color=""blue"">" & [answer] & "</font>"
0
 

Author Closing Comment

by:joanne2468
ID: 38745699
Thank you so much.  I appreciate your help.
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

User Beware!  This is a rather permanent solution to removing your email from an exchange server.  The only way to truly go back is to have your exchange administrator restore your mailbox from backups.  This is usually the option of last resort.  A…
Article by: Leon
Software Metering within our group of companies has always been an afterthought until auditing of software and licensing became a pain point. Orchestrator and SCCM metering gave us the answer and it was an exciting process.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …

770 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