Your code was way off and I think it would take quite a bit to explain it all. So I'm just posting the corrected version and putting my corrections in red and hopefully you can see what you did wrong.
Code:
Sub UseColorListBox()
Dim varItem1 As Variant
Dim varItem2 As Variant
Dim strColor As String
Dim strPriority As String
Dim strWhere As String
' This is for taking the criteria of selection from Colorlist box.
For Each varItem1 In [Forms]![Display/Edit Records].Color_Combo.ItemsSelected
strColor = strColor & Chr(34) & [Forms]![Display/Edit Records].Color_Combo.ItemData(varItem1) & Chr(34) & ","
Next varItem1
' if there is a value then we use it, otherwise don't even set the string (don't use * because it isn't necessary)
If Len(strColor) > 0 Then
strColor = Left(strColor, Len(strColor) - 1)
strColor = " [Color] In(" & strColor & ")"
End If
' This is for taking the criteria of selection from Prioritylist box.
For Each varItem2 In [Forms]![Display/Edit Records].Priority_Combo.ItemsSelected
strPriority = strPriority & Chr(34) & [Forms]![Display/Edit Records].Priority_Combo.ItemData(varItem2) & Chr(34) & ","
Next varItem2
If Len(strPriority) > 0 Then
strPriority = Left(strPriority, Len(strPriority) - 1)
strPriority = " [Priority] In(" & strPriority & ")"
End If
strWhere = "WHERE " & strColor & strPriority
'Now prepare to create temporary query
Dim dbs As DAO.Database
Dim qdf As DAO.QueryDef
Dim strSQL As String
Dim strNewQuery
Set dbs = CurrentDb
strNewQuery = "TemporaryQuery"
' 'Get rid of query if it already exists, ignore errors
On Error Resume Next
dbs.QueryDefs.Delete strNewQuery
On Error GoTo ErrorHandler
'put your select clause here
strSQL = "SELECT CR_List_Details.CR, CR_List_Details.Description, CR_List_Details.Target, CR_List_Details.Color, " & _
"CR_List_Details.Responsible, CR_List_Details.Priority, CR_List_Details.Comment, CR_List_Details.Impact, " & _
"CR_List_Details.[Target Area], CR_List_Details.Team, CR_List_Details.[Gobi Version], CR_List_Details.[G3K Comment]," & _
"CR_List_Details.[Target Team Track], CR_List_Details.[Ram G Track], CR_List_Details.[ASW POCs], " & _
"CR_List_Details.[ETA provided by Tech Team]" & _
"FROM CR_List_Details " & strWhere
' you don't need the semi-colon at the end
' Debug.Print "SQL Statement: " & strSQL
Set qdf = dbs.CreateQueryDef(strNewQuery, strSQL)
dbs.QueryDefs.Append qdf
DoCmd.openquery strNewQuery, acNormal, acEdit
Exit_UseColorListBox:
Exit Sub
ErrorHandler:
MsgBox "Error #" & Err.Number & vbCrLf _
& Err.Description
Resume Next
Resume
End Sub
So, hopefully that helps.