Skip to main content

AccessTr.neT


Kaydetmeden kapatma işlemini nasıl gerçekleştirebilirim?

Kaydetmeden kapatma işlemini nasıl gerçekleştirebilirim?

#28
mdl_gerial isminde modül eklendi.

Option Compare Database
Option Explicit

Global EskiVeriler As VBA.Collection
'www.accesstr.net

Public Function EskiVerileriSakla(GFormadi As String)
On Error Resume Next
Dim GKontrol As Access.Control
Dim GAltformKontrol As Access.Control
Dim GForm As Access.Form

Set EskiVeriler = New VBA.Collection

Set GForm = Forms(GFormadi)

   For Each GKontrol In GForm.Controls

       If TypeName(GKontrol) = "SubForm" Then
           For Each GAltformKontrol In GKontrol.Form.Controls
               If GAltformKontrol.ControlType = acTextBox And GAltformKontrol.Tag = 1 Then
                   EskiVeriler.Add GAltformKontrol.Value & "", GAltformKontrol.Name
               End If
           Next
       Else
           If GKontrol.ControlType = acTextBox And GKontrol.Tag = 1 Then
               EskiVeriler.Add GKontrol.Value & "", GKontrol.Name
           End If
       End If
   Next

Set GKontrol = Nothing
End Function

Public Function EskiVeriAktar(GFormadi As String)
On Error Resume Next
Dim GKontrol As Access.Control
Dim GAltformKontrol As Access.Control
Dim GForm As Access.Form

Set GForm = Forms(GFormadi)

For Each GKontrol In GForm.Controls
   If TypeName(GKontrol) = "SubForm" Then
       For Each GAltformKontrol In GKontrol.Form.Controls
           If GAltformKontrol.ControlType = acTextBox And GAltformKontrol.Tag = 1 Then
               GAltformKontrol.Value = EskiVeriler.Item(GAltformKontrol.Name)
           End If
       Next
   Else
       If GKontrol.ControlType = acTextBox And GKontrol.Tag = 1 Then
           GKontrol.Value = EskiVeriler.Item(GKontrol.Name)
       End If
   End If
Next
End Function

Veri değiştiğinde geri alınacak metin kutularının im özelliğine 1 yazıldı.

Formun geçerli olduğunda olayına 

Call EskiVerileriSakla(Me.Name)

Kodu eklendi.

Geri Al veya kapat butonunun tıklandığında olayına

Call EskiVeriAktar(Me.Name)

Kodu eklendi.
.rar raburabu-Sld_2.rar (Dosya Boyutu: 190,84 KB | İndirme Sayısı: 13)
Cevapla

Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da

Bu Konudaki Yorumlar
Cvp: Güncelleme Sorgusu - Yazar: atoz112 - 10/03/2017, 12:45
Cvp: Güncelleme Sorgusu - Yazar: raburabu - 10/03/2017, 14:56
Cvp: Güncelleme Sorgusu - Yazar: atoz112 - 10/03/2017, 19:58
Cvp: Güncelleme Sorgusu - Yazar: raburabu - 11/03/2017, 00:48
Cvp: Güncelleme Sorgusu - Yazar: atoz112 - 11/03/2017, 13:39
Cvp: Güncelleme Sorgusu - Yazar: raburabu - 11/03/2017, 21:14
Cvp: Güncelleme Sorgusu - Yazar: atoz112 - 12/03/2017, 13:00
Cvp: Güncelleme Sorgusu - Yazar: raburabu - 12/03/2017, 17:24
Cvp: Güncelleme Sorgusu - Yazar: atoz112 - 12/03/2017, 18:01
Cvp: Güncelleme Sorgusu - Yazar: atoz112 - 12/03/2017, 18:24
Cvp: Güncelleme Sorgusu - Yazar: raburabu - 13/03/2017, 10:03
Cvp: Güncelleme Sorgusu - Yazar: atoz112 - 13/03/2017, 17:20
Cvp: Güncelleme Sorgusu - Yazar: raburabu - 14/03/2017, 09:32
Cvp: Güncelleme Sorgusu - Yazar: atoz112 - 14/03/2017, 15:00
Cvp: Güncelleme Sorgusu - Yazar: raburabu - 14/03/2017, 17:06
Cvp: Güncelleme Sorgusu - Yazar: atoz112 - 15/03/2017, 19:05
Cvp: Güncelleme Sorgusu - Yazar: atoz112 - 15/03/2017, 20:08
Cvp: Güncelleme Sorgusu - Yazar: raburabu - 16/03/2017, 13:43
Cvp: Güncelleme Sorgusu - Yazar: atoz112 - 16/03/2017, 18:33
Cvp: Güncelleme Sorgusu - Yazar: atoz112 - 16/03/2017, 18:34
Cvp: Kaydetmeden Kapatma İşlemini Nasıl Gerçekleştirebilirim? - Yazar: ozanakkaya - 20/03/2017, 21:19