Ana içeriğe atla

Form Olayları


Option Compare Database
Dim frm_deneme As Form
Sub form_olay()
'**********************************________Form Oluşturma_______________
'Set frm_deneme = CreateForm
'DoCmd.Close acForm, "Deneme", acSaveYes
'**********************************________Form Kapatma_______________
'DoCmd.Close acForm, "Kapatılacak Formun İsmi", acSaveYes
'DoCmd.Close 'bütün formları kapatır . Kaydetmeyi sorar
'**********************************________Form Adı Değiştirme_______________
'DoCmd.Close acForm, "Form1", acSaveYes
'DoCmd.Rename "deneme", acForm, "Form1"
'**********************************________Form Açma_______________
'DoCmd.OpenForm "deneme"
'**********************************________Form Silme_______________
DoCmd.DeleteObject acForm, "deneme"


'**********************************________Forma Nesne Ekleme_______________

DoCmd.OpenForm "Form1", acDesign
Dim nesne As Control
Set nesne = Application.CreateControl("Form1", acTextBox, acDetail, "ilişkisiz", "Ad", 1000, 1000)
Set nesne = Application.CreateControl("Form1", acTextBox, acDetail, "ilişkisiz", "Soyadı", 1000, 2000)
Set nesne = Application.CreateControl("Form1", acCommandButton, acDetail, "ilişkisiz", "Buton", 1000, 3000)
End Sub

Yorumlar

Bu blogdaki popüler yayınlar

Accessde İfade Oluşturucu Fonksiyonları

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.

Dosyadaki verileri tabloya aktarma

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

Hesaplama

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