2017-10-22 10 views
1

私はテーブルにいくつかのデータを追加するVBAコードを作成しようとしているT_Tickets実行時エラー '3061'パラメータが少なすぎます。期待される8

私は以下のコードを使用しています。

Function addticketScheduleChange() 
Dim route As String 
route = InputBox("Please enter the URL for the ticket:", "Schedule Review") 
Set db = CurrentDb 
Dim frm As Form 
Set frm = Form_Frm_View_Team 

sSQL = "Insert INTO T_Tickets ([CSA Login],[Team Manager],[Schedule Description],[WF Shift Pattern],[Mytime Schedule Description],[Shift Pattern Description],[Mytime Description Code],[Type of Ticket],[Resolved?],[Date Submited],[Ticket Link])" _ 
& "Select " _ 
& "frm.[CSA Login]" & ", " _ 
& "frm.[Team Manager]" & ", " _ 
& "frm.[Schedule Description]" & ", " _ 
& "frm.[CSSM SPD]" & ", " _ 
& "frm.[Mytime Descrription]" & ", " _ 
& "frm.[Shift Pattern Descr]" & ", " _ 
& "frm.[MytimeDescriptionCode]" & ", " _ 
& "'Schedule Change'" & ", " _ 
& False & ", " _ 
& "Now()" & ", " _ 
& "route" 
db.Execute sSQL 
MsgBox ("Record saved.") 

End Function 

助けていただければ幸いです。

答えて

0

これを試してみてください:

sSQL = "Insert INTO T_Tickets ([CSA Login],[Team Manager],[Schedule Description],[WF Shift Pattern],[Mytime Schedule Description],[Shift Pattern Description],[Mytime Description Code],[Type of Ticket],[Resolved?],[Date Submited],[Ticket Link]) " _ 
& "Values (" _ 
& "'" & frm.[CSA Login] & "'," _ 
& "'" & frm.[Team Manager] & "'," _ 
& "'" & frm.[Schedule Description] & "'," _ 
& "'" & frm.[CSSM SPD] & "'," _ 
& "'" & frm.[Mytime Descrription] & "'," _ 
& "'" & frm.[Shift Pattern Descr] & "'," _ 
& "'" & frm.[MytimeDescriptionCode] & "'," _ 
& "'Schedule Change'," _ 
& " False, " _ 
& " Now(), " _ 
& "'" & route & "')" 
関連する問題