My Assistant
![]()
Custom Search
|
![]() ![]() |
![]() |
![]() Post#1 | |
Posts: 1,099 Joined: 16-June 05 ![]() | I have 2 records in a field Record 1 = "The cat sat in the mat" Record 2= "mat" In vba, I need to run a loop that only returns record 2 e.g InStr(1, FieldName , "mat", vbTextCompare) How do I search for an exact string within a string? Thanks |
![]() Post#2 | |
UtterAccess VIP Posts: 7,993 Joined: 24-May 10 From: Downeast Maine ![]() | What you have shown will do what you describe, but will return both records. In the first case it will return 20. In the second it will return 1. If you are looking for an exact match (in this case, "mat" and nothing else, you could do a direct comparison: If Field1 = "mat" Then... |
![]()
Custom Search
|
![]() | Search Top Lo-Fi | 14th December 2019 - 04:25 PM |