Title says it all. Anytime there is an apostrophe in the cell it throws error 3075.
Code:
Me.tboxScientific = DLookup("[ScientificName]", "Species", "[CommonName] = '" & Me.cboCommonName.Text & "'")
Should I include logic to add an escape character when the code encounters an apostrophe? I'm new to VBA, but I understand the concept in other languages.
I tried changing the code to the following (wrapped the final expression in quotes instead of apostrophes [' " '] instead of [" ' "], which works in Python but not in this VBA case I guess -- syntax error):
Code:
Me.tboxScientific = DLookup("[ScientificName]", "Species", '[CommonName] = "' & Me.cboCommonName.Text & '"')