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.
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).
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.
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.
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..
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.
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:
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
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:
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
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...