您尝试将Null值分配给不是数据类型变量的变量-访问 [英] you have tried to assign the Null value to a variable that is not of data type variant - access

查看:84
本文介绍了您尝试将Null值分配给不是数据类型变量的变量-访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请按此处查看gif中的错误. 这是一个新问题,因为我从上一个问题继续看,可以在这里看到:

Please press here for see the error in the gif. This is a new question as I am continue from my last question which can see here: Object variable or with block variable not set - Access 2013

好吧...我正在尝试使这些名称起作用,正如您在gif中看到的那样,它可以起作用.但是,当我添加一个新人员时,会弹出此错误,并说您已尝试将Null值分配给不是数据类型变量的变量"

Alright... I'm trying to get the names working, and it works as you can see in the gif. However when I'm adding a new person, this error just popped up and say "you have tried to assign the Null value to a variable that is not of data type variant"

是的,如果您不知道,它使用的是丹麦语. 它在Access 2013中.

And yes, it's in danish language in case you didn't know. it's in access 2013.

如果有什么我想念的,请问我任何问题.

If there're anything I have missing, then please ask me any question.

推荐答案

据我所知,主表单上的唯一控件是一个列表对象,该列表对象用于选择要在子表单上显示的人

From what I can see, the only control on your main form is a list object which is being used to select the person that is to be shown on the subform.

我认为这种设计正在给您带来麻烦.

I think this design is causing you difficulties.

考虑通过将选择人的控件放在子窗体上来消除对主窗体的需要.

Consider removing the need for a main form, by putting the control that chooses a person on the subform.

子表单中的子表单也似乎不必要.我怀疑您可以基于单个SELECT查询创建单个表单,该查询获取您当前在小子表单中显示的所有数据.

Also the subforms in the subform also seem un-necessary. I suspect that you could create a single form based on a single SELECT query that gets all the data you are currently displaying in your small subforms.

因为我看不懂丹麦语,所以很难理解您的数据,但是表格的结构实际上看起来是错误的!例如,在VERU中,很少有人需要一个带有其名字并由personID链接的子表单的人形!

Because I can't read danish, it is difficult to understand you data, but the structure of your form actually looks wrong! eg it is VERU rare to need a person form with a subform that gives their names and is linked by personID!

我经常推荐 youtube频道,也推荐WROX编程访问书籍.他们都有硬件构造表单的例子.

I often recommend this youtube channel and also WROX Programming Access books. They both have examples of hw to structure a form.

我不知道您有多少使用Access的经验,但是您可能会发现上述有用.

I don't know how much experience you have of using Access, but you may find the above useful.

我通常在表单的标题中使用一个未绑定的组合框,以允许用户选择一个人,然后使用VBA代码转到该人并在表单中显示其记录.

I commonly use an unbound combo box in the header of a form to allow users to select a person, and then use VBA code to goto the person and display their record in the form.

此处介绍了此技术: http://allenbrowne.com/ser-03.html

我希望这会有所帮助.

这篇关于您尝试将Null值分配给不是数据类型变量的变量-访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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