Created
June 10, 2013 14:50
-
-
Save janikvonrotz/5749327 to your computer and use it in GitHub Desktop.
MSAccess: Save custom id to registry
#VisualBasic
#MSAccess
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Private Sub Form_Load() | |
'Identifikatoren zur eindeutigen Speicherung in der Registry | |
Dim PumpeLoadID As Integer | |
Dim NameOption As String | |
'Erstellen des eindeutigen Schlüssels | |
NameOption = "tblpumpe.idPumpe" & Environ("USERNAME") | |
'Lädt die Einstellung | |
PumpeLoadID = CInt(GetSetting("WPDB", "Optionen", NameOption, 0)) | |
If Not PumpeLoadID = 0 Then | |
Forms!frmPumpe.Recordset.FindFirst Me.idPumpe.Name & " = " & Nz(PumpeLoadID, 0) | |
End If | |
End Sub | |
Private Sub Form_Unload(Cancel As Integer) | |
'Identifikatoren zur eindeutigen Speicherung in der Registry | |
Dim NameOption As String | |
'Erstellen des eindeutigen Schlüssels | |
NameOption = "tblpumpe.idPumpe" & Environ("USERNAME") | |
'Speichert Einstellung in Registry | |
If Not Me.idPumpe = 0 Then | |
SaveSetting "WPDB", "Optionen", NameOption, Str(Me.idPumpe) | |
End If | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment