I want to permenantly disable some controls at run time when some event occurs so that it remains disabledduring next execution. Can anyone help me?
Printable View
I want to permenantly disable some controls at run time when some event occurs so that it remains disabledduring next execution. Can anyone help me?
You might want to flirt around with the registry. It is a valuable place to save information from execution to execution. You could just save True or False and when the project loads look into the registry to enable or not. Take a look, it should help you, here are the commands.
SaveSetting appname, section, key, setting
GetSetting(appname, section, key[, default])
I am not sure how your code works but here is a little sample I just threw together.
Private Sub cmdOK_Click()
SaveSetting App.Title, "Properties", "Button1Enabled", _
Button1.Enabled
End Sub
Private Sub Form_Load()
Button1.Enabled = GetSetting(App.Title, "Properties", _
"Button1Enabled", True)
End Sub
That should do it. Good luck.
JK