Access 2013
I'm calling a formula to modify a string and it's changing the values w/in the parent sub.
Example:
Debug.Print Str 'Hello World my name is bob
BOBexists = InStringChceck(Str,"bob")
Debug.Print Str 'HELLO WORLD MY NAME IS BOB
Debug.Print BOBexists 'TRUE
I've used this function, InStringCheck, in Excel VBA before (and it's just an example, all of my string tools are doing this same thing now and I don't know why)
Function InStringCheck(Phrase as string, Term as string) as Boolean
Phrase = UCase(Phrase)
Term = UCase(Term)
if instr(1, Phrase, Term) then InStringCheck = True else InStringCheck = False
end function
In several of my functions I manipulate the input variables, to arrive at a solution, but I don't want those manipulations to persist outside of the function unless I pass them back up - some how they're being passed up, but they're not dimed as public variables

if instr(1, Phrase, Term) then InStringCheck = True else InStringCheck = FalsetoInStringCheck = InStr(1, Phrase, Term). Never returnTrueorFalsebased on a Boolean condition. It's alreadyTrueorFalseby definition. Just return the Boolean condition itself. You don't have to interrogate it and return another Boolean.vbBinaryComparein the call or inOption Compare,InStr()is case-insensitive. SoUCaseisn't needed.