I have the following code, it runs through without errors, the Query is modified and runs, you see the CPU useage rise to 100% for about 20 seconds. BUT whilst list13.requery runs the query it dosent show the results. How can I force it to refresh itself?
Sub List0_Click()
'set the vairiables
SqlStrQ = ""
Q_Count = 0
'build the SQL Statement
For Each item In List0.ItemsSelected
'count the ammount of selected items
Q_Count = Q_Count + 1
If SqlStrQ > "" Then 'if the query is not empty
SqlStrQ = SqlStrQ & " AND Service_No IN (SELECT Service_No FROM User_Que WHERE Q_UID = " & List0.ItemData(item) & ")"
Else 'if the query is empty
SqlStrQ = "SELECT DISTINCT Service_No FROM User_Que WHERE Service_No IN (SELECT Service_No FROM User_Que WHERE Q_UID = " & List0.ItemData(item) & ")"
End If
Next item
'if there were no items selected
If SqlStrQ = "" Then
SqlStrQ = "SELECT [service_no] FROM [user]"
Else
End If
'Modify the Query.
Set db = CurrentDb()
Set Q = db.QueryDefs("F_Auth_Q")
Q.SQL = SqlStrQ
Q.Close
'have the text field show the number of selected records
Me.Text25.Value = Q_Count & " Item(s) Selected"
'requery the list that shows the results of the query F_Auth_Q
Me.List13.Requery
End Sub