In the past I've successfully used this technique to control locking of combo boxes, but can't seem to get it to work for enabling or disabling a button.
Scenario: 2 forms frmLogin, and frmMainNavigation The login form has a combo box that includes a column for Access level, with a value of 1 or 2. After a successful login the login form stays open but is invisible, and the navigation form opens. A text box on the nav form is populated with the access level value. Using this value I've tried to compose a macro (On Load for the Nav form) that sets a button enabled property to True or False. Basically this:
I can't get it to work. I keep getting A Return without GoSub Error. What am I doing wrong?
Scenario: 2 forms frmLogin, and frmMainNavigation The login form has a combo box that includes a column for Access level, with a value of 1 or 2. After a successful login the login form stays open but is invisible, and the navigation form opens. A text box on the nav form is populated with the access level value. Using this value I've tried to compose a macro (On Load for the Nav form) that sets a button enabled property to True or False. Basically this:
Code:
Form : On Load
If txtAccessLevel = 1 Then
SetProperty
Control Name btnOpenAForm
Property Enabled
Value -1
Else
SetProperty
Control Name btnOpenAForm
Property Enabled
Value 0
End If