Du kunne bruge registrerings databasen hvis det skal være rigtig rigtig rigtig hemmeligt.
Lav en form med en knap (Command1) og indsæt koden:
Option Explicit
Dim Counter As Integer
Private Sub SaveSettings()
SaveSetting App.EXEName, "Settings", "Counter", CStr(Counter)
End Sub
Private Sub LoadSettings()
Dim Settings As Variant
Dim Value As Variant
Dim X1 As Integer
Settings = GetAllSettings(App.EXEName, "Settings")
If IsEmpty(Settings) Then Exit Sub
For X1 = LBound(Settings, 1) To UBound(Settings, 1)
Value = Settings(X1, 1)
Select Case Settings(X1, 0)
Case "Counter"
Counter = Val(Value)
End Select
Next X1
End Sub
Private Sub Form_Load()
LoadSettings
Command1.Enabled = (Counter < 3)
End Sub
Private Sub Form_Unload(Cancel As Integer)
Counter = Counter + 1
SaveSettings
End Sub