Like

  • Thread starter Thread starter mission2java_78
  • Start date Start date
M

mission2java_78

Guest
Im almost done with Find and Replace form. I have one problem though it involves pattern matching. Say I have a field Name and in it I have Value: Tom, Tom Guy, Tom
I want to replace Tom with TEST using pattern matching rather than exact match. I have a text field txtReplace (what to search for) and another text field txtReplaceWIth (replace with). I type in TomTTTT and am searching by a pattern match...to Tom or TomGuy and replace it with TEST. But it never works out this way??? Whats wrong with my LIKE SQL Stmnt:

I tried this:
strSQL = "SELECT * FROM " & Me.cboTables.Value & " WHERE " & Me.cboFields.Value & " LIKE " & Chr(34) & Me.txtReplace.Value & "*" & Chr(34)

Its not picking up the Tom Guy?
 
Last edited:
I seem to recall that 'Like' behaves differently depending on whether you are using DAO or ADO.

In DAO you can use the access version, i.e Like 'Tom*', but in ADO you must use Like 'Tom%'.

I could be wrong, but it's worth a try!
 

Users who are viewing this thread

Back
Top Bottom