开发者

Easy way to replace Data with ComboBox? Or populate ComboBox from Data

I took over a very old project written in VB6, it's a mess and I don't really know VB so it would be great if someone could help me.

I have a Data control which gets records from an Access database which I would like to replace with some 开发者_高级运维kind of drop down list - I thought about ComboBox. Unfortunately I cannot get records from the database in the same way as with Data, so I thought about populating ComboBox based on what's in the Data control. How can I achieve it? Or is there a better way to do it?

My last resort is to create all database methods manually in order to replicate Data's behaviour for ComboBox but I think it's too much effort for such a small change.

Thanks in advance!


The Data control does more than just let them browse through the records, it manages the database, current record, data binding, etc. The easiest way to do what you want is to hide/move the data control and use its .Recordset.Find*() methods. Note that DAO is archaic and has been supersceded at least once for VB6 (with ADO)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜