我認爲缺少某些東西或者我使用了錯誤的語法。你能幫我追蹤我的錯誤嗎?查詢值和目標字段的數量不一樣
私人小組AddScholarbtn_Click()
If txtSchoolID = "" Then
MsgBox ("Input ID")
ElseIf txtSSName = "" Then
MsgBox ("Input Surname")
ElseIf txtSGName = "" Then
MsgBox ("Input Given Name")
ElseIf txtSMName = "" Then
MsgBox ("Input Middle Name")
ElseIf txtAddress = "" Then
MsgBox "Null"
ElseIf txtBirthPlace = "" Then
MsgBox "Null"
ElseIf ComboMonth = "" Then
MsgBox "Select Month"
ElseIf ComboDay = "" Then
MsgBox ("Select Day")
ElseIf ComboYear = "" Then
MsgBox "Select Year"
ElseIf comboGender = "" Then
MsgBox "Select Gender"
ElseIf ComboCivilStatus = "" Then
MsgBox "Select Status"
ElseIf txtAge = "" Then
MsgBox ("Input Age")
ElseIf txtContactInfo = "" Then
MsgBox "Null"
ElseIf txtEmail = "" Then
MsgBox "Null"
ElseIf txtGuardian = "" Then
MsgBox "Null"
ElseIf txtGContact = "" Then
MsgBox ("Null")
ElseIf txtYOA = "" Then
MsgBox "Null"
ElseIf comboProgram = "" Then
MsgBox "Null"
Else
Dim ans
ans = MsgBox("Are you sure you want to Save this Scholar?", vbYesNo, "Save")
If ans = vbYes Then
''''''''''''In this line where the yellow color/error occurs
DBConnect.Execute "INSERT INTO tblScholarProfile VALUES(" + txtSchoolID + ",'" + txtSSName + "','" + txtSGName + "','" + txtSMName + "' ," & _
" '" + txtAddress + "','" + txtBirthPlace + "','" + ComboMonth + "'," + ComboDay + "," + ComboYear + "," & _
" '" + comboGender + "','" + ComboCivilStatus + "'," + txtAge + "," + txtContactInfo + ",'" + txtEmail + "','" + txtGuardian + "'," + txtGContact + "," + txtYOA + ",'" + comboProgram + "')"
我真的不得到,我得到這個錯誤。
MsgBox "You have successfully save a new Scholar"
Else
MsgBox "Save unsuccesful!"
End If
Unload Me
MainMenuForm.Show
End If
末次
請幫助。我是一個新手:(