问题描述
我正在尝试在表单上创建一个按钮:
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.
推荐答案
这篇关于“类型不匹配”发生错误,找不到原因的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!