为什么我不能通过查询添加记录? [英] Why can't I add records through my query?

查看:101
本文介绍了为什么我不能通过查询添加记录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我与之合作过的最复杂的数据库之一,如果我不是很清楚我正在尝试仅包含重要细节,那么请提前道歉。

我有以下表格:

tblDevice(DeviceNumber是PK)

tblJob(JobID是PK)

tblDeviceJob


我在tblDevice和tblJob之间有多对多的关系,tblDeviceJob是连接表。我有一个基于查询tblJob的表单,其子表单基于包含tblDeviceJob和tblDevice的查询。这就是我希望我的查询看起来像我的子表单的方式:

展开 | 选择 | Wrap | 行号

解决方案

您的组合框是否将设备编号拉为绑定或未绑定控件?表单底层的查询可能不允许您修改记录。每当您选择一个项目时,查询都不知道该怎么做,因为查询是使用该字段加入的。


您是否尝试更改设备编号或过滤器设备号?


组合框绑定到连接表并从设备表中提取。该查询允许我稍微修改记录集。我可以手动添加JobID(PK的第二个字段),然后保留记录,返回到该记录,然后从组合框中进行选择。但是,我必须首先离开记录。


更新JobID后,尝试AfterUpdate

展开 | 选择 | Wrap | 行号

This is one of the most complicated databases that I have worked with, so apologies ahead of time if I''m not real clear as I''m trying to only include the important details.

I have the following tables:
tblDevice (DeviceNumber is PK)
tblJob (JobID is PK)
tblDeviceJob

I have a many-to-many relationship between tblDevice and tblJob with tblDeviceJob being the join table. I have a form based on a query for tblJob with a subform based on a query that includes tblDeviceJob and tblDevice. This is how I want my query to look like for my subform:

Expand|Select|Wrap|Line Numbers

解决方案

Is your combo box to pull the Device number a bound or unbound control? The query underlying the forms may not allow you to modify the recordest. Whenever you select an item, the query doesn''t know what to do, since the query is joined using that field.

Are you trying to change the device number or filter by the device number?


The combo box is bound to the join table and is pulling from the device table. The query does allow me to modify the recordset somewhat. I can manually add the JobID (the second field of the PK), then leave the record, come back to that record and then make a selection from the combo box. However, I had to have left the record first.


after you update JobID, try AfterUpdate to be

Expand|Select|Wrap|Line Numbers


这篇关于为什么我不能通过查询添加记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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