查询值和目标字段的数量不是相同的访问 [英] number of query values and destination fields are not the same access

查看:100
本文介绍了查询值和目标字段的数量不是相同的访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在我的表上运行这个命令,它会带回标题中显示的错误,任何人都可以看到我错了?

When I run this command on my table, it is bringing back the error shown in the title, can anyone see where I am going wrong?

CurrentDb.Execute "INSERT INTO Table2(VolsID, FirstName, LastName)" & _
"VALUES('" & Me.frst_Name_txt & "," & Me.lst_Name_txt & "," & _
Me.vol_ID_txt & "," & "')"

谢谢!

推荐答案

尝试这个。如果VolsID是字符串字段,则使用单引号将其包装。例如('& Me.frst_Name_txt&')

Try This. If VolsID is a string field, then wrap it with single quote. e.g. ('" & Me.frst_Name_txt & "')

 CurrentDb.Execute "INSERT INTO Table2(VolsID, FirstName, LastName) VALUES (" & Me.vol_ID_txt & ",'" & Me.frst_Name_txt & "','" & Me.lst_Name_txt & "');"

这篇关于查询值和目标字段的数量不是相同的访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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