ボタン クリック イベントで挿入を実行しようとしていますが、クエリ式に演算子がないという実行時エラーが発生し続けます。クエリは次のようになります。何か案は?
Private Sub CmdAdd_Click()
Dim strSql As String
strSql = "INSERT INTO Current_Costs(PO_Number,Lineitemid,Capital_detail,CapitalID,GL_Number,Cost_Type,Cost_Center,Cost_cat,Item_Cost,PO_Date)" & _
" VALUES (" & Me.txtPONum & "','" & _
Me.cmbCapDetail & "','" & _
Me.cmbCapDetail.Column(1) & "','" & _
Me.txtCapID & "','" & _
Me.txtGLNum & "','" & _
Me.cmbCostType & "','" & _
Me.txtCostCen & "','" & _
Me.cmbCostCat & "','" & _
Me.txtCost & "','" & _
Me.TxtPODate & "')"
DoCmd.RunSQL strSql
同じ問題がある同様のクエリがあり、問題がわかりません
CurrentDb.Execute ("UPDATE Current_Costs " & _
"SET PO_Number='" & Me.txtPONum & "'" & _
",Lineitemid='" & Me.cmbCapDetail & "'" & _
",Capital_detail='" & Me.cmbCapDetail.Column(1) & "'" & _
",CapitalID='" & Me.txtCapID & "'" & _
",GL_Number='" & Me.txtGLNum & "'" & _
",Cost_Type='" & Me.cmbCostType & "'" & _
",Cost_Center='" & Me.txtCostCen & "'" & _
",Cost_cat='" & Me.cmbCostCat & "'" & _
",Item_Cost='" & Me.txtCost & "'" & _
",PO_Date='" & Me.TxtPODate & "'" & _
"WHERE LineItemPOID=" & Me.txtID.Tag)
解決した編集