Results 1 to 11 of 11
  1. #1
    Join Date
    Apr 2003
    Posts
    280

    Unanswered: What is the defined syntax to BOLD?

    for example: to space is: " & VBLF & "

    Thank you,

    don

  2. #2
    Join Date
    Apr 2004
    Location
    Kingsland, Georgia
    Posts
    231
    sounds like you're wanting to use HTML-style tags to wrap text or something, so that certain parts, words, etc. would be bold, but not the whole thing. is that correct? if so, i don't know how to do it. i'm trying to find out, though. i know you can create a StdFont object, change its .bold property to true, and assign it to a textbox, or listbox, or another control. but i don't know how to change a word of a sentence in a textbox to bold. clarify for me a little if you can, exactly what you're trying to do with it. i'll see if i can't dig somthing up.

  3. #3
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    As far as I know, a standard Text Box does not support multiple fonts - you can bold it using the .Bold = True property, but it's all or nothing.

    VB offers a "RichText" text box control. To use something similar in Access, use an embedded Word OLE object. Easiest way to do that is to create the text formatted the way you want in Word, copy to the clip board and paste into the form in design view. The default paste will create an OLE object, which looks just like a textbox, but displays the multiple fonts.

    A simple but effective way, if you're looking to display certain things certain ways, is to use overlapping transparent text boxes. As the old saying goes, KISS ("keep it simple silly"). Using conditional if's, I alternate displayed data between regular and bold in several reports to respond to whether the "Approved" field is True or False (or so it appears - it's really overlapping text boxes).

    Have fun!
    Last edited by tcace; 05-20-04 at 11:59.

  4. #4
    Join Date
    Apr 2003
    Posts
    280
    I'm looking to put the code in the message box..

    example:

    Display message box....

    Therapist: Don
    TherapistID: 3242
    FacilityName: Home

  5. #5
    Join Date
    Apr 2004
    Location
    Kingsland, Georgia
    Posts
    231
    that's what i had been trying to do to figure it out. anyways, it doesn't seem that this is possible. You could create a small form that looks like a message box and just use different labels to achieve different colors of font faces. good luck. of course, you can change the label.caption programmatically.

  6. #6
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    Ahh, the MsgBox. I have not been able to find out how to do that, which is not to say it's not possible, but I've been looking for a whie.

    You can create a "message box" that is actually a form in disguise, however, and put anything you want on it.

    You can create a form that looks like a message box by setting it's Pop-Up property, turning off the control boxes, and various other format settings. You can get the little symbols that appear in a text box by using a screen capture and cropping to just the icon and then embedd (paste) the image in the form.

    Screen capture: get what you want on the screen, press the "Print Screen Button", open Paint (or any other image editing program) and Paste.

    have fun

  7. #7
    Join Date
    Apr 2003
    Posts
    280
    too much work for y'all just mention. If there is a way to go to the next line( &VBLF&) then I'm surely there is a way to bold the words. I'll keep y'all posted when I find out about it. I don't have the VB reference book with me, that's why I ask on here..

  8. #8
    Join Date
    Apr 2004
    Location
    Kingsland, Georgia
    Posts
    231
    VBLF is a char of sorts. it is not an HTML-style "tag", like <br>. if you find something, let us know. thanks and good luck. p.s. if you hit F2 in a code window, it'll bring up the references and you can search for Bold and find the places it's usable.

  9. #9
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    vbCrLf is a character string, not a tag.
    vbCrLf = ASCII Char 10 & ASCII Char 13 (which equals "carriage return and line feed"). You could acheive the same effect using the Chr function.

    vbLF, VBCrLf etc. are text operators. Bold is a display attribute. To add emphasis, perhaps adding extra lines?

    Code:
    MsgBox "I really want you to note today is:" & vbCrLf & vbCrLf & "MY BIRTHDAY" & vbCrLf & vbCrLf & "Got it?",vbYesNo+vbExclamation,"Take Note"
    good luck and keep us posted if you find something.

    ps: today is not really my birthday

  10. #10
    Join Date
    Nov 2003
    Posts
    1,487
    Ok folks...here are a couple of tricks I use to add some fire into my Message Boxes.

    Access 97 allowed you to break your message box into paragraphs, and to bold the first paragraph in the Message Box, just like Access itself does with standard messages. However, creating this functionality in Access 2000 or 2002 is a bit more limited and tricky as noted below.

    The "@" symbol added to your message text will break the message into paragraphs, with text before the first @ shown in bold. You are limited to three paragraphs with the "@" symbol following each paragraph. If you only want to break for two paragraphs, you must use two @@ symbols at the end of the second paragraph.

    The following code shows a formatted message box for Access 95-97:

    Code:
    If MsgBox("You have just deleted the current record.@ _ 
    	 Click ""OK"" to confirm your delete or ""Cancel"" to undo your deletion.@@ ", _
    	 vbOKCancel, "My AppName") = vbOK Then
    	 'Do somthing here
    End If
    In Access 2000 and 2002 (Xp), this functionality is not directly available because the VBA environment is now separate from Access. You can however replicate it (with certain limitations) by using the EVAL() function as a wrapper around the message box code. So it would look like:

    Code:
    If Eval("MsgBox('You have just deleted the current record.@ _ 
    	 Click ""OK"" to confirm your delete or ""Cancel"" to undo your deletion.@@', _
    	 1, 'My AppName')") = vbOK Then
    	 'Do somthing here
    End If
    Note: You can not use variables in your message boxes using this method and you also can't use VB intrinsic constants such as vbOKCancel, the latter must be given as specific numbers which you can obtain using the object browser.

    Please let me know what type of nifty formats you come up with. I'm absolutely sure everyone here would appreciate it...

  11. #11
    Join Date
    Apr 2004
    Location
    Sydney Australia
    Posts
    369
    too much work for y'all just mention

    It must be at least 117 times easier to have a form open than try and work out ways to change a msg box.

    Open msg box and open form takes the same effort. From that point on the form represents the least work....117 times less work

    Mike

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •