My Assistant
![]() ![]() |
|
|
Feb 25 2010, 09:28 AM
Post
#1
|
|
|
UtterAccess Guru Posts: 996 From: Rochester NY USA |
Having a problem using the Search function with the #characters limit ... Add & row
Have a combo box, part of a record search section on the form, and want to add a blank row to the rowsource - which is to be interpreted as 'No Filtering' on this field. The Select statement is currently: SELECT tblInkRequests.CSRId, First(SALESAGENT.SANAME) AS CSRName FROM tblInkRequests LEFT JOIN SALESAGENT ON tblInkRequests.CSRId = SALESAGENT.SACODE GROUP BY tblInkRequests.CSRId ORDER BY First(SALESAGENT.SANAME); How would this be modified to add a blank (or NULL) row? |
|
|
|
Feb 25 2010, 09:32 AM
Post
#2
|
|
|
UtterAccess VIP Posts: 9,266 From: Wisconsin |
Ed,
You may want to check out Adding "All" to a listbox or combobox at the Access Web. It sounds like what you're trying to do. Hope this helps, Dennis |
|
|
|
Feb 25 2010, 10:19 AM
Post
#3
|
|
|
UtterAccess Guru Posts: 996 From: Rochester NY USA |
Ed, You may want to check out Adding "All" to a listbox or combobox at the Access Web. It sounds like what you're trying to do. Hope this helps, Dennis Your suggestion helped in a round about way... Kept getting 'aggregate' errors using the UNION query approach (maybe I had a typo error I wasn't detecting). But, I googled using your website reference 'Adding "All"...' and found another solution using DISTINCT. This works great: SELECT DISTINCT tblInkRequests.CSRId, SALESAGENT.SANAME AS CSRName FROM tblInkRequests LEFT JOIN SALESAGENT ON tblInkRequests.CSRId = SALESAGENT.SACODE UNION SELECT Null as CSRId, "" As CSRName from tblInkRequests ORDER BY CSRName FROM tblInkRequests LEFT JOIN SALESAGENT ON tblInkRequests.CSRId = SALESAGENT.SACODE Thanks for the guidance. OOPS! That didn't work! I've got to go back to the totals query ... Forgot DISTINCT is distinct on combination of all the columns in a row, not the column it precedes. I'll post an update after working on this. |
|
|
|
Feb 25 2010, 10:55 AM
Post
#4
|
|
|
UtterAccess Guru Posts: 996 From: Rochester NY USA |
Final Results Are In And It's Working ... Phew.
Here's the query: SELECT tblInkRequests.CSRId, First(SALESAGENT.SANAME) AS CSRName FROM tblInkRequests LEFT JOIN SALESAGENT ON tblInkRequests.CSRId = SALESAGENT.SACODE GROUP BY tblInkRequests.CSRId UNION SELECT Null as CSRId, "" As CSRName FROM tblInkRequests ORDER BY CSRName; I must have had a typo before. |
|
|
|
Feb 26 2010, 09:12 AM
Post
#5
|
|
|
UtterAccess VIP Posts: 9,266 From: Wisconsin |
Glad I could help!
Dennis |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 18th May 2013 - 12:09 PM |