本文介绍了运行时错误'3061':参数太少。预期1。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好!我需要一些关于我的代码的专业建议。我无法看到问题出在哪里

Hello! I need some professional advice on my codes. I can't see where the problem is here


 CurrentDb.Execute "DELETE FROM Subject " & _
 " WHERE SubjCode=" & Me.frmSubjSub.Form.Recordset.Fields("SubjCode")


它说它的参数太少,预期1.其中"主题"表是"SubjCode"和"SubjCode"。是一个字段名。



It says it has too few parameters, expected 1. where "Subject" is a Table and "SubjCode" is a field name.


推荐答案

CurrentDb.Execute" DELETE FROM Subject WHERE SubjCode ='" &安培; Me.frmSubjSub.Form!SubjCode& "'",dbFailOnError

CurrentDb.Execute "DELETE FROM Subject WHERE SubjCode='" & Me.frmSubjSub.Form!SubjCode & "'", dbFailOnError

假设SubjCode是一个文本字段。如果它是数字,只需取出我添加的单引号。希望有所帮助......

That assumes SubjCode is a Text field. If it's numeric, just take out the single quotes I added. Hope that helps...


这篇关于运行时错误'3061':参数太少。预期1。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-09 23:13