Arkadaşlar merhaba,
Aşağıdaki kodlarla TextBoxa girdiğim bilgileri kaydediyorum.Tamamını doldurduğum zaman bir sorun yok fakat TextBox lardan birini boş bıraksam hata veriyor.
kodlarda nasıl bir değişklik yapabiliriz acaba?
Private Sub kaydet_Click()
Set RS = CreateObject("ADODB.recordset")
strSQL = "SELECT * FROM [MyTable] Where Marka='" & TextBox1 & "'"
RS.Open strSQL, adoCN, 1, 3
RS.AddNew
RS("Marka") = TextBox1
RS("Model") = TextBox2
RS("Tedarikci") = TextBox3
RS("Adet") = TextBox9
RS.Update
TextBox1 = Empty
TextBox2 = Empty
TextBox3 = Empty
TextBox9 = Empty
RS.Close
RefreshDB
Set kayit = Nothing
End Sub
Aşağıdaki kodlarla TextBoxa girdiğim bilgileri kaydediyorum.Tamamını doldurduğum zaman bir sorun yok fakat TextBox lardan birini boş bıraksam hata veriyor.
kodlarda nasıl bir değişklik yapabiliriz acaba?
Private Sub kaydet_Click()
Set RS = CreateObject("ADODB.recordset")
strSQL = "SELECT * FROM [MyTable] Where Marka='" & TextBox1 & "'"
RS.Open strSQL, adoCN, 1, 3
RS.AddNew
RS("Marka") = TextBox1
RS("Model") = TextBox2
RS("Tedarikci") = TextBox3
RS("Adet") = TextBox9
RS.Update
TextBox1 = Empty
TextBox2 = Empty
TextBox3 = Empty
TextBox9 = Empty
RS.Close
RefreshDB
Set kayit = Nothing
End Sub