开发者

How to add item to ms access List/Combobox programatically in addition to recordset

开发者 https://www.devze.com 2023-01-04 23:09 出处:网络
I have a combobox in Access 2003 whose recordset is obtained from a stored procedure. I need to find a way to add an additional item to the lists programmatically. The stored procedure returns the fol

I have a combobox in Access 2003 whose recordset is obtained from a stored procedure. I need to find a way to add an additional item to the lists programmatically. The stored procedure returns the following StatusID and StatusName list.

1,Open 
2,Closed
3,In-Process
4,Under Review

I want to add the option "All Cases" with the StatusID of "-1" to the开发者_开发问答 combobox but this value is not present in the database so I cannot pull it out from the stored procedure. How do I add it to the combobox in VBA? Thanks.


One way is to use a Union Query:

SELECT Distinct -1 as ID, "All Cases" As What FROM SomeTable
UNION
SELECT <Real stuff>
0

精彩评论

暂无评论...
验证码 换一张
取 消