change properties on event

  • Thread starter Thread starter principe
  • Start date Start date
P

principe

Guest
ciao people
i've been looking around for days, hope u can solve my problem!

my form is made up of several combo boxes
i wanna write a code which after a selection in any combo box sets the properties of the latter as follow: enabled NO and locked YES (just the opposite of the default value)

can u please help me?
 
the code you want is
Yourfield.enabled = false
yourfield.locked = true

If you put the code in the after update event of the combobox it will work but you wont vbe able to re select the combo box to change your selection
 
actually that's my problem, i've already tried it and doesnt work.

error 2164

translating from italian it would be something like "it is not possible to deactivate a control which has currently an active state"

any idea?
 
You have to move the focus to another object, then lock/disable the text box in question.

Yourfield2.SetFocus
Yourfield1.enabled = false
Yourfield1.locked = true
 

Users who are viewing this thread

Back
Top Bottom