![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, I have a simple form that contains a combobox, which has supplier names in it. A report is run based on a simple query. The report displays supplier details for a particular supplier that had been selected from the combobox. Basically I want the query to be able to handle the following scenario:- Have a look at the combobox value and display records for that particular supplier. (this is currently achieved) However if no items have been selected from the combobox then display details for all suppliers. How can I translate this to a queries expression builder? Any ideas would be most welcome. Thanks |
#3
| |||
| |||
|
|
kamal_akhtar (AT) hotmail (DOT) com (Kamal Akhtar) wrote in message news:<64ad11db.0405061035.48d5c7c0 (AT) posting (DOT) google.com>... Hi, I have a simple form that contains a combobox, which has supplier names in it. A report is run based on a simple query. The report displays supplier details for a particular supplier that had been selected from the combobox. Basically I want the query to be able to handle the following scenario:- Have a look at the combobox value and display records for that particular supplier. (this is currently achieved) However if no items have been selected from the combobox then display details for all suppliers. How can I translate this to a queries expression builder? Any ideas would be most welcome. Thanks Hello, First of all, it wasn't stated how your getting the combox value and using it in your query. As such I'll assume that the criteria expression in your query for the field being sourced looks something like this: [Forms]![frmFormNameHere]![cmbComboNameHere] This forces the query to look to your form, with the combobox, for the information required. Now, if you want to display all data if there is no data in the combobox, duplicate the expression above by adding an "or" after it and copying the expression and pasting it after the or with an "IsNull" at the end. Example: [Forms]![frmFormNameHere]![cmbComboNameHere] or [Forms]![frmFormNameHere]![cmbComboNameHere] is null What happens is, the query looks for it's criteria in the combobox and if it is null, then will display all records. Regards, Ray |
![]() |
| Thread Tools | |
| Display Modes | |
| |