使用记录集而不是DLookup [英] Using a recordset instead of DLookup

查看:138
本文介绍了使用记录集而不是DLookup的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好 -


摘要:

-I有一个与People表的ODBC连接。这个表位于我们的CRM系统中,连接是只读的。


-I对这个People表有一组查询,以一个名为 q_People <的最终UNION查询结束/ b>拉 Persons_ID 名称部门办公室


-我的本地表包含 Person_ID 字段


-I不能在我的表单'的记录源中包含UNION查询这使得记录不可更新。


-我想在我的表单上显示人员部门和办公室,基于 Person_ID


我的表单上有2个名为Department and Office的未绑定字段


我有以下Form_Current事件:

Hello -

Summary:
-I have an ODBC Connection to a People table. This table is in our CRM system and the connection is read-only.

-I have a set of queries against this People table ending in a final UNION query called q_People that pulls the Persons_ID, Name, Department and Office.

-My local table contains the Person_ID field

-I can''t include the UNION query in my form''s Record Source as this makes the record not updateable.

-I want to display the persons Department and Office on my form, based on the Person_ID

I have 2 Unbound fields on my form named Department and Office

I have the following Form_Current event:

展开 | Sel ect | Wrap | 行号

推荐答案

这看起来更像是Access VBA比VB 4/5/6问题还要问题。


你在标题中提到了DLookUp,但你在帖子中没有说出任何关于它的内容。

是的,您可以为所有人生成一次记录集,然后在需要时搜索记录集。
This looks more like an Access VBA question than a VB 4/5/6 question.

You mention DLookUp in the title but you didn''t say anything about it in the post.

Yes, you can generate the recordset once with all the people and then just search the recordset when you need to.


@Rabbit


感谢您的回复。


我的道歉 - 我没有意识到我在错误的部分。


我将在Access VBA下重新发布并澄清标题。


Sandra
@Rabbit
Thank you for your reply.

My apologies - I did not realize I was in the wrong section.

I will repost under Access VBA and clarify the title.

Sandra


那里''不需要重新创建它,我可以为你移动线程。我对你的询问的回答仍然有效。因为我回答了它在Access中的假设。
There''s no need to recreate it, I can move the thread for you. My responses to your inquiry still stands though. Because I was answering off the assumption that it was in Access.


这篇关于使用记录集而不是DLookup的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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