search and replace characters in table 
Author Message
 search and replace characters in table

I'm trying to figure out how to "search and replace" on some non-english
characters that appear in my access 97 tables. I would like to be able to
write mini-programs (modules?) to do this since my data will change but the
operations I need to perform will be necessary with each new data set.

Any hints, suggestions, information on how to create a set of modules to do
this would be much appreciated. I own the following resources -- "Access 97
for Busy People", "Microsoft Office 97 Programming With VBA for Dummies
(For Dummies)", and "Access 97 Developer's Handbook". Unfortunately, my
quick perusal of these sources hasn't given me a lot of help.

Thank you in advance,
SGCapps



Tue, 25 Jul 2000 03:00:00 GMT  
 search and replace characters in table

Hi,

Sorry I haven't had much experience with non-english characters but I think
you should be able to define an update query which uses the Instr function.

Conversly, if you're famiilar with the TableDefs collection, you can iterate
thru all the fields and pass them to a function.  I'm including the
functions as given in the Knowledge Base article Q109825. For more info, try
this article and Help topics on TableDefs collection.
      '============================================================
      'The following function will:
      ' - Find the tabs in a Text or Memo field.
      ' - Call another function to replace the tabs.
      '============================================================
      Function FindTabs (WhichField As String) as String
         Dim x As Integer, Text As String
         Dim start As Integer
            start = 1
            x = 1
            Text = WhichField
            Do Until x = 0
               ' Chr(9) is the Tab character.
               ' Replace Chr(9) with the ANSI code for the character
               ' you are searching for.
               x = InStr(start, Text, Chr(9))
               start = x + 1
               If x > 0 And Not IsNull(x) Then
                  Text = ReplaceTabs(x, Text)
               End If
            Loop
            FindTabs = Text
      End Function
 '==================================================================
      ' The following function is called from the FindTabs() function. It
      ' accepts two arguments, text and start. The function replaces tabs
      ' with %. It returns the updated text.
 '==================================================================
      Function ReplaceTabs(start As Integer, text As String) As String
         ' Replace % with the character you want to substitute.
         Mid(text, start, 1) = "%"
         ReplaceTabs = text
      End Function

HTH
--
Just my $.001
Dev Ashish
---------------



:I'm trying to figure out how to "search and replace" on some non-english
:characters that appear in my access 97 tables. I would like to be able to
:write mini-programs (modules?) to do this since my data will change but the
:operations I need to perform will be necessary with each new data set.
:
:Any hints, suggestions, information on how to create a set of modules to do
:this would be much appreciated. I own the following resources -- "Access 97
:for Busy People", "Microsoft Office 97 Programming With Vba for Dummies
:(For Dummies)", and "Access 97 Developer's Handbook". Unfortunately, my
:quick perusal of these sources hasn't given me a lot of help.
:
:Thank you in advance,
:SGCapps
:



Tue, 25 Jul 2000 03:00:00 GMT  
 search and replace characters in table


says...

Quote:
> I'm trying to figure out how to "search and replace" on some non-english
> characters that appear in my access 97 tables. I would like to be able to
> write mini-programs (modules?) to do this since my data will change but the
> operations I need to perform will be necessary with each new data set.

Look for the adhReplace (or is it adhReplaceAll?) function in Access 97
Developer's Handbook (Sybex), if you have that book. If not, let me know
and I'll post it here. -- Ken


Wed, 02 Aug 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Search and replace, how to replace with special characters

2. Replacing Foreign Characters with Local Characters in a Field of a Table

3. VB character Search and Replace

4. Search and Replace Between Characters - Newbie Question

5. Search/Replace Em Space/En Space characters

6. Search & Replace Unicode Characters

7. Search/replace raised characters

8. Searching and replacing Characters

9. Replace Character in Table

10. Word Search & Replace Text in a Table

11. Replace Range of Characters with a specific character?

12. Replace fisrt two characters in a field.

 

 
Powered by phpBB® Forum Software