Hello -
I am using Access 2010.
I have a form in which I am using a textbox (SearchTbx) as a search textbox to search through my song records. I have seen posts where single apostrophes are dealt with in the DCount function but I am using an SQL statement. I am not super new at Access VBA but I am still learning.
The following SQL string works fine:
All is well with the above until I use a single quote such as if a song title starts with "I'm". I have seen where folks suggest the use of either Chr(34) or Chr(39) to overcome this issue but I cannot figure out how/where to install these Chr suggestions.
Any assistance is greatly appreciated.
Thank you.
I am using Access 2010.
I have a form in which I am using a textbox (SearchTbx) as a search textbox to search through my song records. I have seen posts where single apostrophes are dealt with in the DCount function but I am using an SQL statement. I am not super new at Access VBA but I am still learning.
The following SQL string works fine:
Code:
Dim SQL as String
SQL = "SELECT SongT.*, ArtistT.* FROM SongT INNER JOIN ArtistT ON SongT.ArtistID = ArtistT.ArtistID" _
& " WHERE [SongChords] LIKE '*" & Me.SearchTbx & "*'"
All is well with the above until I use a single quote such as if a song title starts with "I'm". I have seen where folks suggest the use of either Chr(34) or Chr(39) to overcome this issue but I cannot figure out how/where to install these Chr suggestions.
Any assistance is greatly appreciated.
Thank you.