Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Problem selecting records 1

Status
Not open for further replies.

ZOR

Technical User
Jan 30, 2002
2,963
GB
I have a listbox, which when clicked on fills a label to show user what they have selected. On clicking the list, another fills using a query. However the selection list refuses to pick all records. I have removed all other fields from the query in case there was a null somewhere, but it still will not work.

A Record it will not work on is:
1st Stage: Lucon - Les Sables d'Olonne

The query is
Me.LP1.RowSource = "SELECT TXMASTERS.EpisodeTitle, " _
& " FROM (TXMASTERS INNER JOIN TXCLIPS ON TXMASTERS.ID1=TXCLIPS.ID1)" _
& "WHERE TXMASTERS.EpisodeTitle Like '" & "*" & Me![IP2].[Caption] & "*' "
Me.LP1.Requery

I thought it might be something to do with characters in the caption - 1st Stage: Lucon - Les Sables d'Olonne

Thanks
 
I think I've already showed you the safe way:
Code:
& "WHERE TXMASTERS.EpisodeTitle Like '*" & Replace(Me!IP2.Caption, "'", "''") & "*' "

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks it works. I looked back through my earlier postings and yes you did put that into one of my replies, but it did not sink in, sorry. Now I look at it I understand. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top