Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disabling a control

Status
Not open for further replies.

Syerston

Programmer
Jun 2, 2001
142
GB
What is the best way to disable a text box on moving the focus out of the box. No matter which event procedure I use it keeps coming back "You can not disable a control while it has the focus." John
 
there are a few ways to do this one of which is on the lost focus event:

[fieldname].locked = true

or
on the after update event:

[nextfieldname].setfocus
[fieldname].locked = true

this way it moves to the next field so that the field you want to lock no longer has the focus that way you are able to lock it.

hope these are alright for you.
 
That's Great.

My problem was I was trying to use .Enabled rather than .Locked.

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top