- Katılım
- 6 Temmuz 2008
- Mesajlar
- 1,875
- Excel Vers. ve Dili
- OFFİCE 2010- TÜRKÇE
Kod:
Sub sil()
Dim Con As Object, Rs As Object, Sorgu As String
Application.ScreenUpdating = False
Set Con = CreateObject("Adodb.Connection")
Set Rs = CreateObject("Adodb.RecordSet")
ml.Range("A2:I" & Rows.Count).ClearContents
Con.Open "provider=microsoft.ace.oledb.12.0;data source=" & ThisWorkbook.Path & "\" & "MalzemeListesi.mdb" & ""
deg2 = stok.BA.Value
Sorgu = "SELECT * FROM MalzemeListesi WHERE BarkodNumarasi = '" & deg2 & "' "
Rs.Open Sorgu, Con, 1, 3
Rs.Delete
Rs.Close: Con.Close
Set Con = Nothing: Set Rs = Nothing: Sorgu = ""
Application.ScreenUpdating = True
End Sub
Yukarıdaki kodları 3'e bölebilirmiyim?
Birkaç yol denedim fakat hata verdi.
Mesela ;
Başla;
Kod:
Dim Con As Object, Rs As Object, Sorgu As String
Application.ScreenUpdating = False
Set Con = CreateObject("Adodb.Connection")
Set Rs = CreateObject("Adodb.RecordSet")
ml.Range("A2:I" & Rows.Count).ClearContents
Con.Open "provider=microsoft.ace.oledb.12.0;data source=" & ThisWorkbook.Path & "\" & "MalzemeListesi.mdb" & ""
Bitir;
Kod:
Rs.Close: Con.Close
Set Con = Nothing: Set Rs = Nothing: Sorgu = ""
