If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Query to show all if parameter is blank
Hi,
I run a query which returns me filtered record based on textbox1 value on form (master). I have added the criteria in the design view of the query. [Forms]![Master]![textbox1] If textbox1 value is vlank then no records are returned, whereas if textbox1 value is blank then i wish to ahev all record, please help me deal with this... thx! Boss |
#2
|
|||
|
|||
Query to show all if parameter is blank
Switch the query to SQL View.
Locate the WHERE clause. If it says: WHERE SomeField = [Forms]![Master]![textbox1] change it to: WHERE ((SomeField = [Forms]![Master]![textbox1]) OR ([Forms]![Master]![textbox1] Is Null)) Careful with the bracketing if you have other criteria here. -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Boss" wrote in message ... Hi, I run a query which returns me filtered record based on textbox1 value on form (master). I have added the criteria in the design view of the query. [Forms]![Master]![textbox1] If textbox1 value is vlank then no records are returned, whereas if textbox1 value is blank then i wish to ahev all record, please help me deal with this... thx! Boss |
#3
|
|||
|
|||
Query to show all if parameter is blank
Thanks! It helped me a lot...
Boss "Allen Browne" wrote: Switch the query to SQL View. Locate the WHERE clause. If it says: WHERE SomeField = [Forms]![Master]![textbox1] change it to: WHERE ((SomeField = [Forms]![Master]![textbox1]) OR ([Forms]![Master]![textbox1] Is Null)) Careful with the bracketing if you have other criteria here. -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Boss" wrote in message ... Hi, I run a query which returns me filtered record based on textbox1 value on form (master). I have added the criteria in the design view of the query. [Forms]![Master]![textbox1] If textbox1 value is vlank then no records are returned, whereas if textbox1 value is blank then i wish to ahev all record, please help me deal with this... thx! Boss |
Thread Tools | |
Display Modes | |
|
|