禁止访问消息以防止从 Excel 重复导入 [英] Suppress Access Message to Prevent Duplicate Import from Excel

查看:63
本文介绍了禁止访问消息以防止从 Excel 重复导入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将数据从 Excel 导入到 Access 中的现有表中,并希望取消显示以下消息.

I am importing data from Excel into an existing table in Access and want to suppress the below message.

我尝试使用多字段索引将新记录导入表中,也尝试先导入到临时表,然后将新记录附加到现有表中.

I have tried using a multi field Index to import new records into the table and have also tried importing firstly to a Temporary table and then appending new records to the existing table.

然而,在这两种情况下,它仍然会弹出以下消息,我想避免用户看到(因为他们可能会意外单击是).

However under both scenarios it still gives the below message pop up which I want to avoid the user seeing (as they could click yes by accident).

如果我在宏中尝试 SetWarnings = No,它只会重新导入所有条目,而不管它们是否重复,因此不起作用.

If I try SetWarnings = No in a macro, it just reimports all entries irrespective of whether they are duplicates or not so that doesn't work.

我将不胜感激

谢谢

推荐答案

不要导入 Excel 数据,而是链接它们.

Don't import the Excel data, link them.

现在你有一个链接表.在将其与现有表连接的查询中将其用作源.

Now you have a linked table. Use that as source in a query where you join it with the existing table.

仅选择不存在的链接记录.

Select only linked records that are not already present.

将查询更改为追加查询.您可以根据需要随时运行此查询.

Change the query to an append query. This query you can run as often as you like.

当收到新的 Excel 文件时,只需将链接文件替换为新文件即可.

When a new Excel file is received, just replace the linked file with the new file.

这篇关于禁止访问消息以防止从 Excel 重复导入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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