query criteria from combobox

vojaka

Registered User.
Local time
Today, 06:21
Joined
Jan 5, 2009
Messages
17
Hey,

got a problem with criteria which comes from combo box. Combo box values are taken from table.

Well, problem is when combo is empty, query does not show anything.
I used this expression in query criteria. [Forms]![frmReportManager]![cmbAgentName] or [Forms]![frmReportManager]![cmbAgentName] is Null

NB! Before that i got problem, that query criteria did not get value from combo box at all. I decided to write code for this

Private Sub cmbAgentName_Change()
cmbAgentName.Value = cmbAgentName.Text
End Sub

Could it be the problem for showing all records in query.

Sorry for bad English and thanks to all who posted answers.
 
Well if I remove the code, query does not show anything. Might it be connected with that combo is taking value directly from a table. When I put table - query - combo it is working.
I do not have special code to run the query. i get combo(criteria) - query - report - On Click(show report)
 

Users who are viewing this thread

Back
Top Bottom