Sorry, I submitted before I finished. What I need to do is subscript the numbers in red, but the number "2" in black needs to be left full size. These exceptions to the subscripting would always occur after the "•". Can you qualify a VB script regular expression to not include some things...
strongm and/or anyone that can help
I have been working with you suggested code, but I am still having trouble implementing it. I want to use it in an Access Report, but there is a bug with ActiveX controls where you can't see the rich textbox content in print preview mode, so I am using a MS...
Sheco,
My rich text box name was originally rtb1, but I changed it to match strongm's code. Now my rtb name is "RichTextBox1", but I don't have anything called Text1. What is that line of code doing anyway? The line:
RichTextBox1.Text = Text1.Text comes from strongm.
I guess we may have to...
Sheco,
It didn't give the same error message! But now I get a Microsoft Visual Basic Run-time '424'; Object required error message and the debug routine highlights the line
RichTextBox1.Text = Text1.Text
Sheco,
I am not sure what is going on. I got your code to work like a charm in the same database I have the report! I have Access 2002, but not sure if that is the problem!
Sheco,
I thought I had to tell the MS Access Report to run this code explicitly. In the Properties of the MS Access Report there is an Event tab. One of the events is "On Open" and I have set that equal to my function name which is Report_Open().
I have tried to open the report without...
Hi Sheco, strongm,
Current code is:
Private Sub Report_Open()
Dim re As RegExp
Dim mymatches As MatchCollection
Dim mymatch As Match
richTextBox1.Text = Text1.Text
Set re = New RegExp
re.Global = True
re.Pattern = "\w\d"
Set mymatches =...
Hi strongm,
I have added the reference library and added back in 'Option Explicit' and there are no longer undefined variables.
How do I now get this to run? In a MS Access report, there are no buttons. I have this RTB in the detail section of the report and I have an On Format, On Print...
Hi strongm,
I am getting some errors:
User-defined type not defined for New RegExp
removed options explicit, helped some, but still some undefined variables? Suggestions?
Thanks for your time.
P.S. Sheco...you must be a chemist or a good student!
Pentahydrate it is.
strongm,
Thanks for the code. I have placed it in my MS Access Report. How is the code activated? Does it run automatically when the report is opened? Do I need to add it to the ON FORMAT as an event procedure?
Sorry for the questions, it is all new to me.
Hi johnwm,
My first sticking point is how to select only numbers in the string? This is complicated a bit as I hope the following example will show. Given the [MF]= CuS04·2H2O, I only want the code to subscript numbers that DON'T appear after a "·".
In this example then, after subscripting...
Hello All,
I need help with a RichTextBox Control. I have an MS Access report that has a RichTextBox control. The control gets its data from a field in the database that contains chemical formulas, e.g. H2O. What I need to do is search the RichTextBox for any numbers and make them...
misscrf,
Thanks for you input, I did not mention it, but I did set the detail section property Can Shrink to yes as well as the individual "Label" text boxes and data text boxes. I started to build the report from scratch and I now have the "Labels" and text boxes being hidden depending on the...
dhookom and ZmrAbdulla,
Thanks so much for responding. I started down a slightly different path which will hopefully lead to the same result. Using suggestions from thread703-415220, I have changed mylabels to text boxes and used the following "code" in the control source for the "Label" text...
Hi dhookom,
Thanks for your feedback, unfortunately I must be doing something wrong, because it is not working for me. Do you have any suggestions as to where I might look for a problem? I have set the appropriate text boxes to Can Shrink - Yes. Could it have something to do with my Border...
Thanks for your suggestion, unfortunately it is not working for me. Using your method I still see the word "Description" when the field [Description] is null. I must be missing something.
You are correct, if the text box has no value, nothing is displayed...but I wanted to make the text box...
Hello All,
I hope you can help with this question. I have seen numerous threads with very similar or the same issue, but I cannot get the solutions to work for me. In a report detail section I have a function that I want to hide a text box and the corresponding label if the text box has a...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.