I'm trying to search through a txt file for a certain string using a Do While Not EOF loop and then either return or just set a flag of that line number whenever the string is found.
I'm extremely new to VBA with access. What would be the most basic way to go about doing this? I'm using Access 2007
Thank you
Here is what I have so far, I pulled it from various examples online to try to get it to work.
Dim myFile As String
Dim text As String
Dim textline As String
Dim posIAV As Integer
myFile = "file path"
Open myFile For Input As #1
Do While Not EOF(1)
Line Input #1, textline
text = text & textline
Loop
Close #1
posIAV = InStr(text, "IAVs ADDED in this release include")
MsgBox (posIAV)
Best Answer
Just replace MyString below with whatever it is you're looking for.