PDA

View Full Version : List Blank Records Using Combo Box



tammyl
07-05-2009, 08:38 PM
Hi,

I have a form with a combo box in the header and records listed in a datasheet view subform.

Records can have a blank entry in the Accured column to indicate I am still to review the record.

In the combo box in the header the dropdown list shows a blank option as the first option. When i select this option, as i wish to see all blank records, nothing happens.

Q - How can i use the combo box to list all blank 'Accured' records.

This is the info i have allocated on the field in 'RowSource'
SELECT DISTINCT tblInvoices.Accured FROM tblInvoices ORDER BY tblInvoices.[Accured];

Q2 - Can i have the user select two options in the combo box and have those matching records listed.

Thanks alot

Cheers Tammyl

OBP
07-06-2009, 02:23 AM
Tammy, first of all, what kind of Combo are you using a "Select" or a "Find Record" Combo?
If the "Blank" Combo line is actually a "Null" value you may be able to use that fact to find the Blank Records.
Question 2 is more difficult to answer, I have seen Multi Select Combos but I have never seen them used for finding Records.

OBP
07-06-2009, 02:29 AM
Tammy, re your second question, I actually found this (heavy) VBA code using Multi Select List boxes, see the response from Majp

http://www.tek-tips.com/viewthread.cfm?qid=1553463&page=2

CreganTur
07-06-2009, 12:49 PM
WOuld it work to add a WHERE clause:
WHERE IS NULL([Accured]) OR [Accrued] = ""
Adding this to your SQL would restrict the results to accounts where Accrued is NULL or empty string.

HTH:thumb