I'm using access 2007.
I have a question regarding textbox.
I am using a textbox to display a message.
May i know is the textbox can be multiple-formatting?
For example: Some words are bold, some words are underline?
Hi and welcome to the forums! I do not know a way to do this easily. If the message box is static (always the same), you can create a form with the preformatted text and call it when needed.
If it is slightly dynamic - meaning there is line that is bolded and the a following line that is not, you can still do the same and adjust the label properties through VBA to say what you mean.
For instance, a form with some preformatted stuff, label(s) on it that will be dynamic. You could pass some value to the pop-up (OpenArgs). A select case statement based on the value could manipulate the 'dynamic' label to express a different message.
There is a way to create it on-the-fly in VBA, you can do web searches for dynamic form creation, but it is in-depth. I went down this path once and abandoned it because it wasn't worth the effort for what I was trying to accomplish and went with a preformatted pop-up.
Apologies for not a specific resolution, but can only hope that it helps.
Actually in 2007 I hear it is possible (haven't tried myself). According to Allen Browne's site:
For the first time, you can format text a text box: bold, italics, bulleted lists, fonts, colors, etc. Use for comments, merge letter reports, ...
Applies to text boxes that are unbound, bound to an expression, or bound to a Memo field that has the Text Format property set to Rich Text (in table design.)
Note: stores HTML (not RTF.)
A brief test showed the "Text Format" property of the textbox controls this. I assume you can find more in 2007 help.
Not too come across harsh, but I assumed the user wanted to use the MsgBox command. I may also be in further error, but assumed to make some words bolded and others not, such as ...
Actually i am a very beginner. It seem like very complicated to me. May be your are right. It is not worth for wasting time in this. Anyways thanks alot for your advice.
I have a question regarding textbox.
I am using a textbox to display a message.
May i know is the textbox can be multiple-formatting?
For example: Some words are bold, some words are underline?
Qiqinuin ... for this purpose, are you wanting a message to pop-up to the user if they, for instance, type in the wrong type of data or click on something wrong?
Or are you wanting a textbox that is already on the form to go bold or something as a result of the user doing something?
Qiqinuin ... for this purpose, are you wanting a message to pop-up to the user if they, for instance, type in the wrong type of data or click on something wrong?
Or are you wanting a textbox that is already on the form to go bold or something as a result of the user doing something?
Thank you for your response.
Actually the message i want to displays in a TextBox is combined data which is from other textboxs that user need to key in.
I don't want to use MsgBox because i have to copy the message to the phone and sent this message out. The purpose i want to bold the data is because it is easier to user to check whether there are error when user key in the data
In the properties of the text box you want to modify the font in, select the Data tab. Then, in the Text Format row, select Rich Text.
Now, to do this in VBA, set up whatever condition it is you are checking for. In this example, I will assume there are 3 text boxes that will be concantenated and presented into a 4th. The data in the 3 text boxes will each have a different format.
txtTextBox4 (the final) now has the data of the other three textboxes. The data of each textbox is formatted differently ...
txtTextBox1 is formatted as bold (b).
txtTextBox2 is formatted as italics (i).
txtTextBox3 is formatted as underlined (u).
Note, for other formats, etc, MS Access uses HTML tags for the storage and rendering. Feel free to check the web for more tags to modify for your purposes.
Okay, I think I have gotten all of the egg off of my face for the wrong interpretation ...
To your question,
Yes, in Access 2007, you can.
In the properties of the text box you want to modify the font in, select the Data tab. Then, in the Text Format row, select Rich Text.
Now, to do this in VBA, set up whatever condition it is you are checking for. In this example, I will assume there are 3 text boxes that will be concantenated and presented into a 4th. The data in the 3 text boxes will each have a different format.
txtTextBox4 (the final) now has the data of the other three textboxes. The data of each textbox is formatted differently ...
txtTextBox1 is formatted as bold (b).
txtTextBox2 is formatted as italics (i).
txtTextBox3 is formatted as underlined (u).
Note, for other formats, etc, MS Access uses HTML tags for the storage and rendering. Feel free to check the web for more tags to modify for your purposes.
Thank you so much for your help. It's really what i need. Amazing^^
Do you know that whether excel 2007 userform can set the textbox to richtext format?
Outstanding! ... for Excel, I am sorry, I do not know ... I do not use it that much at all. You might want to try posting the same sort of question in the Excel group though.