hi everyone
i am getting the following error , please help
Code:strSQL = strSQL & "WHERE (((Source.Headline) Like " * " & Chr(34) & [Text0].value & Chr(34) & " * " );"
hi everyone
i am getting the following error , please help
Code:strSQL = strSQL & "WHERE (((Source.Headline) Like " * " & Chr(34) & [Text0].value & Chr(34) & " * " );"
Try this debugging technique and I think you'll see what's going on.
http://www.baldyweb.com/ImmediateWindow.htm
I see a couple of problems.
i have made some changes to mty code , but it is just giving me the following error :
the part thats bold and underlined is where i am getting an error saying that invalid Sql statementCode:Private Sub Command2_Click() Dim strSQL As String strSQL = "SELECT Cluster_Dept.ID, Cluster_Dept.Cluster_ID, Cluster_Dept.Dept_ID, Clusters.Cluster_Desc, Department.Dept_Desc, " & _ "Source.Day_Month_Year, Source.Original_Source, Source.Headline, Source.Issue, Source.Analysis, Source.Action " & _ "FROM Source INNER JOIN (Department INNER JOIN (Clusters INNER JOIN Cluster_Dept ON Clusters.Cluster_ID " & _ "= Cluster_Dept.Cluster_ID) ON Department.Dept_ID = Cluster_Dept.Dept_ID) ON Source.ID = Cluster_Dept.ID " If (([Text0] <> " ")) Then strSQL = strSQL & " " & "WHERE [Source].Headline = " Like "*" & Chr(34) & [Text0] & "*" & ";" End If 'code: 'MsgBox strSQL ' Assign SQL code to query that the entry form uses CurrentDb.QueryDefs("Search_by_Clusters and date").SQL = strSQL 'Open the report DoCmd.OpenReport "Search_by_Clusters and date", acViewReport End Sub
So you haven't tried what I suggested? Why not just use a parameter query?
hi i have just solved the issue , simple solution really . but if you have any time on your hands , i would like to know if it possible to create an "all" feature . so far i have created a positive, negative and neutral feature. now i would like to know if it is possible to create an "all" feature .
Might help if you post the code that does the others, but in general to get all you'd just leave that field out of the WHERE clause.
i have sorted this error out , thanks again for your help it is truly appreciated![]()
Happy to help. It could help future users if you posted the working solution.
sure i don't mind at all, here is the solution...
Code:If (([Search] <> " ")) Then strSQL = strSQL & " " & "WHERE Source.Headline Like" & Chr(34) & "*" & [Search] & "*" & Chr(34)