Results 1 to 13 of 13
  1. #1
    adnancanada is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2010
    Posts
    121

    How to bold text within concatenate ?

    Hi I have built Vendor Agreement I have two fields [Vendor Name], [P_Name]. I am using MS Access 2013.



    I want to concatenate but I want my vendor name and P_name should be bold and rest of the text should be normal. Is it possbile?
    Here is the code I put in access query.



    comp: [vendor name] & "," & " a company incorporated under the law of" & " " & [P_Name] & " " & "(''Vendor'')" & "."

    it should show in my report like that.

    Rubbermaid Inc, a company incorporated under the law of Alaska (''Vendor'').

  2. #2
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    since 2007, access uses html type coding for font styles

    To make them display in a form or report, the control richtext property needs to be set to true.

    I've not tried it but if you surround the bits you want in bold with (I think) e.g.

    "<b>" & myboldtext & "</b>" & mynormaltext

    google 'access vba richtext' or similar to find codes which work with access or format some text in a richtext control then copy and paste to notepad so see the codes

    this is a link for all the options

    https://support.office.com/en-us/art...rs=en-US&ad=US

  3. #3
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Try setting the control source to "<b>" & [vendor name] & "</b>, a company incorporated under the law of <b>" & [P_Name] & "</b> ('Vendor')"
    If you have to have double quotes around Vendor, substitute ASCII character code for double quotes - Chr(34) or ""Vendor"")"

    Darn! too slow again. Ditto on the Rich text format.
    Last edited by Micron; 02-02-2016 at 05:46 PM. Reason: rich text & had 2 single quotes around vendor
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716

  5. #5
    adnancanada is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2010
    Posts
    121
    Quote Originally Posted by Micron View Post
    Try setting the control source to "<b>" & [vendor name] & "</b>, a company incorporated under the law of <b>" & [P_Name] & "</b> ('Vendor')"
    If you have to have double quotes around Vendor, substitute ASCII character code for double quotes - Chr(34) or ""Vendor"")"

    Darn! too slow again. Ditto on the Rich text format.
    Thanks for you help . Where to put this ? in query or report. I tried both but didn't work.

  6. #6
    adnancanada is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2010
    Posts
    121
    Quote Originally Posted by Ajax View Post
    since 2007, access uses html type coding for font styles

    To make them display in a form or report, the control richtext property needs to be set to true.

    I've not tried it but if you surround the bits you want in bold with (I think) e.g.

    "<b>" & myboldtext & "</b>" & mynormaltext

    google 'access vba richtext' or similar to find codes which work with access or format some text in a richtext control then copy and paste to notepad so see the codes

    this is a link for all the options

    https://support.office.com/en-us/art...rs=en-US&ad=US

    I am using Access 2013 I believe it does not have richtext option. what is other solution. I tried but didn't work.

  7. #7
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Quote Originally Posted by adnancanada View Post
    I am using Access 2013 I believe it does not have richtext option. what is other solution. I tried but didn't work.
    If that is your impression, then it has to be the reason why you didn't get it to work. I'm confident it is an option in version 2013, since it was just introduced in version2007.
    In the property sheet > Data Tab for the form/report control, choose Rich Text as the Text Format property and put your concatenation expression in the control as suggested. You cannot use this formatting technique in a query if that's what you're trying to do, but I think you're not - according to post #1. Our assumption is that you're doing this in an unbound control that you are using to concatenate values from other controls on the form/report. As for doesn't work, please see my signature, bullet #1.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  8. #8
    Perceptus's Avatar
    Perceptus is offline Expert
    Windows 7 64bit Access 2007
    Join Date
    Nov 2012
    Location
    Knoxville, Tennessee
    Posts
    659
    Can you group the controls in a layout group(columns)? If so you could then just apply formatting to the report for the data objects seperately. Layout view helps a lot.

  9. #9
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    That is doable, but it has it's own issues. Rendering the text in a consistent manner so it all lines up throughout the report is pretty much impossible, I'd say. Each control would have to be wide enough to hold the maximum expected length, and the leftmost text would have to be right justified and the rest left justified in order to keep it looking like a continuous string. That would leave varying gaps between the leftmost character and the column beside it when the value in the control is short, and the left margin of the first word would be all over the place.
    The solution proposed works in 2007, and I'd be surprised if the property was removed after that.

  10. #10
    Perceptus's Avatar
    Perceptus is offline Expert
    Windows 7 64bit Access 2007
    Join Date
    Nov 2012
    Location
    Knoxville, Tennessee
    Posts
    659
    You could set the Grow Properties for the controls as well as Shrink properties so that formatting remained consistent.

    Last edited by Perceptus; 02-04-2016 at 12:26 PM. Reason: Doesnt work like I thought

  11. #11
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    That is for the vertical height, not the width
    Setting Visual Basic Description
    Yes True (–1) The section or control grows vertically so that all data it contains can be printed or previewed.

  12. #12
    adnancanada is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2010
    Posts
    121
    Quote Originally Posted by Micron View Post
    If that is your impression, then it has to be the reason why you didn't get it to work. I'm confident it is an option in version 2013, since it was just introduced in version2007.
    In the property sheet > Data Tab for the form/report control, choose Rich Text as the Text Format property and put your concatenation expression in the control as suggested. You cannot use this formatting technique in a query if that's what you're trying to do, but I think you're not - according to post #1. Our assumption is that you're doing this in an unbound control that you are using to concatenate values from other controls on the form/report. As for doesn't work, please see my signature, bullet #1.
    Hi , you were right. Sorry it was my mistake. I found richtext i was looking in query property before but I found it on report. It s working fine. Thank you very much for helping me.

  13. #13
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    would have saved time if you had read my post properly

    To make them display in a form or report, the control richtext property needs to be set to true.
    guess that is the benefit of using bold

Please reply to this thread with any new information or opinions.

Similar Threads

  1. PDF output file does not show the text as bold
    By Donothing in forum Import/Export Data
    Replies: 2
    Last Post: 10-13-2013, 11:58 AM
  2. Replies: 2
    Last Post: 01-01-2013, 11:15 PM
  3. How to create a message box with bold text
    By uronmapu in forum Access
    Replies: 5
    Last Post: 07-12-2012, 03:09 AM
  4. How do I Bold the first Text in ListBox
    By uronmapu in forum Access
    Replies: 8
    Last Post: 06-17-2012, 09:32 AM
  5. Bold portion of text in memo field.
    By kenton.l.sparks@gmail.com in forum Access
    Replies: 1
    Last Post: 05-01-2012, 03:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums