编译错误:找不到方法或数据成员? [英] Compile error: Method or data member not found?

查看:136
本文介绍了编译错误:找不到方法或数据成员?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


在我提出问题之前,我想说一下这个论坛有多好,以及对一个完整的新手有多大的帮助。


此时此刻,我无法创建VBA语法(我认为这就是所谓的),它可以从另一个(主窗体)更新一个组合框(在子窗体中)。我在示例Northwind数据库中尝试了相同的代码,它工作得很好。我试过用''''替换'''''无效,并花了很长时间阅读互联网上的其他主题。其中有些是我目前无法理解的任何用途。


我在第一个组合框中的After Update功能代码如下:

展开 | 选择 | Wrap | 行号

解决方案

我不知道你桌子的结构,但你确定吗? />

展开 | 选择 | 换行 | 行号


< blockquote>嗨Lizy。第一个观察:如果你仔细观察第7行,你会发现FindFirst语句在对Me的值的引用的两侧的字符串中都有单引号![nestcombo]。这是引用所谓的字符串文字值的正确方法 - 其中控件的内容作为文本包含在要查找的字符串中。您在第11行中错过了这些内容,而应该读取:

展开 | 选择 | Wrap | 行号


感谢您的回复,
bird_id不是表的名称,但字段来自名为tNBIRDS的表。

展开 | 选择 | Wrap | < span class =codeLinkonclick =LineNumbers(this);>行号


Hello,

Before I ask my question, I want to say how good this forum is and how much help it has been to a complete novice.

At this moment in time I am having trouble creating VBA syntax (I think that is what it is called) that works to update one combo box (in subform) from another (in the main form). I have tried the same ''code'' in the sample Northwind database and it works just fine. I have tried replacing ''.'' with ''!'' to no avail and have spent a long time reading other threads on the internet. Some of them are just beyond my understanding at the moment to be of any use.

My code for the After Update function in the first combo box is the following:

Expand|Select|Wrap|Line Numbers

解决方案

I don''t know the structure of your table, but are you sure

Expand|Select|Wrap|Line Numbers


Hi Lizy. First observation: if you look closely at line 7 you will see that the FindFirst statement has single quotes within the string on either side of the reference to the value of Me![nestcombo]. This is the correct way to refer to what are known as string literal values - where the contents of the control are included as text within the string to be found. You have missed these out in line 11, which instead should read:

Expand|Select|Wrap|Line Numbers


Thank you for the replies,

The bird_id is not the name of the table, but the field is from a table called tNBIRDS.

Expand|Select|Wrap|Line Numbers


这篇关于编译错误:找不到方法或数据成员?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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