如何用可更新的记录集填充组合框? [英] How to populate a combobox with an updatable recordset?

查看:62
本文介绍了如何用可更新的记录集填充组合框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我使用的是Access 2003,但大多数将使用此数据库的人都使用Access 2002.我不确定这是否会产生很大的影响但是反正这里是我的题。哦,我正在创建一个应收帐款数据库。


我的主要问题是,您可以使用记录集填充多列组合框吗?


我想在一个comboBox中选择一个CustID,并使用afterupdate事件为Invoices组合框创建记录源。


我希望能够从中删除发票记录将付款应用于记录集。因此,再次单击发票组合框时,不会显示该发票。当然,如果他们改变主意或在他们选择的发票中犯了错误,他们应该可以选择将其添加回发票组合框。


我一直在寻找解决方案的日子,但我开始认为这是不可能的,我想这样做。我知道还有其他方法可以完成同样的事情,但我希望这会更简单。


感谢您的帮助。

First of all, I''m use Access 2003 but most of the people that will be using this database with be using Access 2002. I''m not sure if that will make much of a difference but anyways here is my question. Oh and I''m making an Accounts Receivable Database.

My main question is, can you populate a multi column comboBox by using a recordset?

I would like to choose a CustID in one comboBox and use afterupdate event to create the recordsource for the Invoices comboBox.

I want to be able to remove the invoice records from the recordset when a payment will be applied to it. Therefore when the Invoice comboBox is click on again that invoice is not shown. Of course if they change their mind or made a mistake in the invoice they chose, they should have the option to add it back to the Invoice comboBox.

I''ve been looking for days for a solution but I''m starting to think that this is not possible the way I would like to do it. I know there are other ways to accomplish the same thing but I was hoping that this would be an easier way.

Thanks for your help.

推荐答案

更新,我刚刚发现了我所遗漏的内容。


我正在使用...... Me.InvNo.recordset = rstInv''顺便说一下,这个记录集被宣布为公共。


我缺少的是.....设置Me.InvNo.recorderset = rstInv


这很有效。现在我需要知道如何删除记录集中的项目或更新记录集中的字段,然后重新查询它以过滤掉发票。


我试过...... Me.InvNo。 RemoveItem(rstInv.Index)但收到错误。


谢谢...
Update, I just found out what I was missing.

I was using......Me.InvNo.recordset = rstInv ''By the way, this recordset is declared as Public.

What I was missing was.....Set Me.InvNo.recorderset = rstInv

This worked. Now I need to know how to remove item in the recordset or update a field in the recordset and then requery it to filter out the invoice.

I tried...Me.InvNo.RemoveItem (rstInv.Index) but got an error.

Thanks...


我想这取决于你是否要删除该项目从实际的记录集,或只是从组合框 - 因为我认为这些事情中的任何一个都可以完成。从您刚刚发布的内容来看,看起来您只是想从组合框中删除它。


Pat
I guess it depends on whether you want to remove the item from the actual recordset, or just from the combo box - because I think either of those things could be done. Judging from what you just posted, it looks like you''re just trying to remove it from the combo box.

Pat


是的我想从组合框中删除它,但由于组合框由记录集填充,这不是一回事吗?另外,我不必重新查询,也不会只是引入我必须开始的相同信息。


我尝试使用removeitem但是它说记录源类型有成为一个值列表。


那么现在是什么?


Evy
Yes I would like to remove it from the combo box but since the combo box is populated by the recordset isn''t that the same thing? Also don''t I have to requery and won''t that just bring in the same info I had to begin with.

I tried using removeitem but it said that the recordsourcetype had to be a value list to use.

So now what?

Evy


这篇关于如何用可更新的记录集填充组合框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆