sonja_n00b
Sonja
- Local time
- Today, 09:59
- Joined
- Sep 15, 2004
- Messages
- 8
Private Sub kn_search_Click()
Dim str_search As String
If (Me.vld_search = "") Or (IsNull(Me.vld_search)) Then Exit Sub
str_search = Me.vld_search
List0.RowSource = "SELECT tbl_log.log_id AS ID, tbl_log.log_datum AS [Date], tbl_log.log_titel AS Title, tbl_log.log_tekst AS [Text], tbl_user.user_naam AS Author, tbl_log.log_humeur AS Mood, tbl_log.log_lied AS Song, tbl_log.log_album AS Album " & _
"FROM tbl_user INNER JOIN tbl_log ON tbl_user.user_id = tbl_log.log_user " & _
"WHERE (((tbl_log.log_titel) Like '*" & str_search & "*') OR ((tbl_log.log_tekst) Like '*" & str_search & "*') OR ((tbl_user.user_naam) Like '*" & str_search & "*')) " & _
"ORDER BY tbl_log.log_datum;"
End Sub
This is what I've got. At the WHERE statment you have '*" & str_search & "*'. But If I fill out a value with an apostphe than it all doesn't work.
Dim str_search As String
If (Me.vld_search = "") Or (IsNull(Me.vld_search)) Then Exit Sub
str_search = Me.vld_search
List0.RowSource = "SELECT tbl_log.log_id AS ID, tbl_log.log_datum AS [Date], tbl_log.log_titel AS Title, tbl_log.log_tekst AS [Text], tbl_user.user_naam AS Author, tbl_log.log_humeur AS Mood, tbl_log.log_lied AS Song, tbl_log.log_album AS Album " & _
"FROM tbl_user INNER JOIN tbl_log ON tbl_user.user_id = tbl_log.log_user " & _
"WHERE (((tbl_log.log_titel) Like '*" & str_search & "*') OR ((tbl_log.log_tekst) Like '*" & str_search & "*') OR ((tbl_user.user_naam) Like '*" & str_search & "*')) " & _
"ORDER BY tbl_log.log_datum;"
End Sub
This is what I've got. At the WHERE statment you have '*" & str_search & "*'. But If I fill out a value with an apostphe than it all doesn't work.