Fonksiyonlar ve Kullanımı boş form seçeneği ile yeni bir form oluşturulur.Oluşan form tasarım görünümüyle açılır. iki ayrı metin kutusu eklenir özellik Sayfası seçilir. Özellik Sayfasından tümü/Denetim Kaynağının yanındaki ... tıklanır.İfade oluşturucudan fonksiyon seçilir.
Option Compare Database Sub akt() Dim db As Database Dim rst As Recordset Set db = CurrentDb() Set rst = db.OpenRecordset("Tablo1") Open "d:\ak.txt" For Input As #1 Do While Not EOF(1) rst.AddNew Input #1, ad, soyad, yaş rst("ad").Value = ad rst("soyad").Value = soyad rst("yaş").Value = yaş rst.Update Loop Close #1 End Sub
Sub hesapla() Dim db As Database Dim rst As Recordset Set db = CurrentDb toplam = 0 Set rst = db.OpenRecordset("giriş") Do Until rst.EOF If rst.Fields(2).Value = "teknosa" Then toplam = toplam + (rst.Fields(3).Value * rst.Fields(4).Value) End If rst.MoveNext Loop MsgBox toplam End Sub
Yorumlar
Yorum Gönder