I have never tried to do any VB programming before in Microsoft Access (so keep in mind I am a greenhorn newbie) but I had a problem that needed solving. I have a database full of articles but there is one problem. The articles are full of special characters, that show as boxes, which cannot be removed normally in Access like you can regular characters like a, b, c, 1, 2, 3....etc.
Those special characters are only 2 really. The special characters are the hard return & tab characters. I found this article from Microsoft (
http://support.microsoft.com/?kbid=210433 )that will allow you to replace one special character for another character. In that example it replaces the tab character with a % character.
I got that to work for me just fine with a simple replace of the tab for a % BUT...
What I really wanted to do was to replace the tab character with a longer string of text like the html code ( ) for three non breaking spaces (in order to keep the tab's look in the html output) (AND was going to also replace the hard returns with <br>). Well problem is this... when the module replaced it
it would place only the & from the first character in the replacement text. Then I went to Mid(strText, intStart, 1) = " " and changed the 1 to 18 and it seemed like it worked but it did not just replace the tabs in the article but also some of the following characters too.
Example: (<tab> represents the tab character)
would turn into something like this...
What I really wanted was this...
I hope this was clear what I was trying to do. I only wanted to replace the tab but I wanted to use more than one character when I do that. I used this code below given by Microsoft....
Code is..