Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need a Null value at the top of a list.

Status
Not open for further replies.

regava

Programmer
May 24, 2001
152
US
I am using a combo box to create a list of options. I need a null value at the top of the list (ie. Null,Y,N). I have seen a query that does this by selecting the query in the RowSource of the combo box. I will appreciate if anybody remembers it to let me know. Have a wonderful day.
 
Tiggerlili3 thanks for your reponse. I looked at your link and that is not what I am looking for in this particular case. However, it will be usefull for something else.
There is a querey that places null on top of a list that I have used in the past but I cannot find now. I you or anybody remembers it, please let me know. I will keep looking and if I find I will post it.
 
In tht case, I have a few questions:

(1) Is the list that shows in the combo box right now a value list or does it come from a query?
(2) When you say you need a null at the top of the list, which of the following do you mean?
(a)the first row in the drop down will be blank and when it is selected the query that will use the value from this combo box will return all records
(b)the first row in the drop down will be blank and when it is selected the query that will use the value from this combo box to return all records where the appropriate field is null
 
regava,

The link took me to a blank page so I'm not sure what 'didn't work' for you.

Your question isn't very clear but maybe a Union Query is what you're after. EG: My combo box has a RowSource of SELECT repId, myRepName FROM tblSalesReps ORDER BY repId; and I want to have a selection to select all of the Sales Reps, I would change the RowSource to

SELECT Null, "All Reps" FROM tblSalesReps UNION SELECT repId, myRepName FROM tblSalesReps ORDER BY repId;

If that's not it, could you be more specific about what it is you're looking for. While you have used it in the past, that really doesn't tell us much about what you're looking for.



HTH



When Galileo theorized that Aristotle's view of the Universe contained errors, he was labeled a fool.
It wasn't until he proved it that he was called dangerous.
[wink]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top