“类型不匹配”发生错误,找不到原因 [英] "Type mismatch" error occurs, can't find cause

查看:94
本文介绍了“类型不匹配”发生错误,找不到原因的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我正在尝试在表单上创建一个按钮:

1.从链接到表格的表单中获取ComputerID 1,

2.检查表2中是否有匹配的ComputerID,并且

3.打开查询qryEditData,并且

4.如果不匹配可以找到,在表2中添加一条新记录并自动输入ComputerID。


目标是在表1中创建新记录并在表1中创建新记录时将ComputerID字段与1对1关系匹配。是的,将它们放在一个表中会更容易,而且它们本来就是,但是当我试图在多用户环境中创建条件字段级安全性时,我必须要有点创造性:


表1是读写的,表2是只读的,除了通过qryEditData,带有OWNERACCESS OPTION的查询,并且限制为当前表单ComputerID和设置为False的True / False标准。如果True / False字段设置为True,我最终会添加一个MsgBox提示。


所以uesr点击按钮,

如果没有记录存在,它创建一个新记录,然后打开qryEditData查询。

如果记录存在并设置为False,则打开查询。

如果记录存在且设置为True,它会调用一个MsgBox。


不幸的是,当点击按钮时,我得到一个Type Mismatch。错误。


我正在使用Access 2003和Windows XP。然而,数据库本身仍然是2000格式。它创建于5年前。这是将其转换为多用户数据库的项目的一部分,因为更多人希望访问并为不同方设置限制。这很好,这似乎是我要解决的唯一问题。

Hi,

I''m trying to create a button on a form that:
1. Takes the ComputerID from the form linked to Table 1,
2. Checks Table 2 for a matching ComputerID, and
3. Opens the query qryEditData, and
4. If no match can be found, adds a new record in Table 2 and enters the ComputerID automatcially.

The goal is to create a new record in Table 2 when a new record is created in table 1 and have the ComputerID fields match with a 1-to-1 relationship. Yes, it would be easier to have them in one table, and they originally were, but when I''m trying to create conditional field-level security in a multiuser environment I have to be a little creative:

Table 1 would be read-write, Table 2 would be read-only, except through qryEditData, a query with OWNERACCESS OPTION and limtited to the current form ComputerID and a True/False criteria set to False. Eventually I''ll add a MsgBox prompt if the True/False field is set to True.

So the uesr clicks on the button,
If no record exists, it creates a new record, then opens the qryEditData query.
If the record exists and set to False, it opens the query.
If the record exists and set to True, it disploays a MsgBox instead.

Unfortunately, when clicking the button, I get a "Type Mismatch" error.

I''m using Access 2003 with Windows XP. The database itself still in 2000 format, however. It was created over 5 years ago. This is part of the project to convert it to a multiuser database because more people wanted access and set limits to different parties. It''s going great, and this seems to be the only problem I have left to solve.

展开 | 选择 | 换行 | 行号

推荐答案

是计算机ID文本吗?

因为如果是,那么你需要:
Is ComputerID text?
Because if it is then you need:
展开 | 选择 | Wrap | 行号



是否为ComputerID文本?

因为如果是,那么您需要:
Is ComputerID text?
Because if it is then you need:
展开 | 选择 | Wrap | 行号


如果有效则那就好了。但是如果您仍然想要使用第一个版本,我们可以尝试找出它抛出错误的位置。它会告诉你哪一行代码抛出了错误吗?
If it works then that''s good. But if you still want to use the first version, we can try to figure out where it''s throwing the error. Does it tell you which line of code is throwing the error?


这篇关于“类型不匹配”发生错误,找不到原因的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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