In following segment of code, the Pop-up form "frmWhichBE" prompts the user to choose between a "Business" or "Personal" back-end database. The set of TableDefs are that same in both back-ends so the code is simply determining which BE is current versus which BE the user wants. The BE's are named to include .......Data(Business).mdb or .......Data(Personal).mdb. The InStr function returns zero even when there's a match. I have examined the values of strMode (Global string variable) and the value of strCurLinkBE in Debug to insure that the value of strMode is either contained in strCurLinkBE or it is not. (The two MsgBox statements are just a part of verifying code functionality at the current stage of code development.)
I'm missing something?
Code:
If bolPer = True And bolBus = True Then
intConfig = 3
DoCmd.OpenForm "frmWhichBE", acNormal, , , , acDialog 'Show user option
strCurLinkDB = CurrentDb.TableDefs("tblRegister").Connect 'Current BE DB?
If Nz(InStr(1, strMode, strCurLinkDB, vbTextCompare)) = 0 Then 'User chose strMode
MsgBox "Okay, we'll re-link to " & strMode
Else
MsgBox "We're already linked to " & strMode
End If
End If