简单追加查询不起作用 [英] Simple Append Query Not Working

查看:106
本文介绍了简单追加查询不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个简单的追加查询,它从表单中获取数据并将其附加到表格中。

Hi,
I have a simple append query which takes data from a form and appends it into a table.

展开 | 选择 | Wrap | 行号

推荐答案

我建​​议,不要使用外部查询,在表单上放一个按钮,单击该按钮添加记录,并使用一些代码,如这个:
I would suggest, rather than use an external query, put a button on your form that you would click to add the record, and use some code like this:
展开 | 选择 | Wrap | 行号


感谢ChipR,

我之前尝试通过创建一个Sql字符串并通过docmd.openquery strSql打开它并尝试使用DoCmd来通过vba获取查询。 RunSQL strSQL都不起作用,然后我只是删除了表并创建了一个新表,它工作正常,即使我仍然没有看到任何理由为什么旧表会导致任何问题。这就是我讨厌使用反复试验来解决问题,没有任何东西以这种方式学习。关于它为什么不起作用的任何建议,请记住我在我的帖子中概述的表的规格。


谢谢
Thanks ChipR,
I had tried previously to get query to work through vba by creating a Sql string and opening it via docmd.openquery strSql and also tried DoCmd.RunSQL strSQL both did not work, then I just deleted the table and made a new table, and it was working fine, even though I still don''t see any reason why the old table would cause any issues. That''s what I hate about fixing using trial and error, nothing is learnt in that manner. Any suggetions on why it wouldn''t work, keeping in mind the specs of the table I have outlined in my initial post.

Thanks


您必须小心该字段的格式。日期被#'和文字包围,用引号括起来。立即想到的唯一另一件事是拥有一个名称是保留字或在其他地方使用过的字段。
You have to be careful with the format of the field. Dates surrounded by #''s and text surrounded by quotes. The only other thing that comes to mind immediately is having a field with a name that was a reserved word or used elsewhere.


这篇关于简单追加查询不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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