Enabling without Me.TxtName.Enable

baldeagle

Registered User.
Local time
Yesterday, 21:32
Joined
Nov 9, 2004
Messages
38
I have code set up to disable a textbox by clicking on it (Yes, that right, I want the textbox disabled as soon as it is clicked on) with
Code:
Me.Txt.enabled = false during the _onClick Event.
However, the with which I am working has 500 textboxes. Is there a way to call a function or something that would disable just the textbox that is clicked on?
 
Why?

You can not disable an object that has the focus! That will not work using the OnClick event of the text box that the user has just clicked.

Why don't you just lock it? Set the locked property of that text box to Yes.

If you must do what you are asking then you will have to set the focus to another object before you can lock the text box within the OnClick event of the text box in question.

500 text boxes within one form?!? Please post a picture of that form!!!
 
500 text boxes...

Well, lets just say that the form has to be printed as a report with page breaks to keep it in check. I didn't design the form, its just my problem to deal with.
Basically, the owner of the form wanted the filter by selection funtionality, by listing all distinct entries for that field. One way to do this would have been with a unsourced copy of the form, and each textbox changed to a combobox. Not wanting to do that, I chose to write a function that would popup a form in dialog mode with a combo to select the avaliable values. It then put that critera into the form's filter. The only problem was that if you choose the same field twice, then it would mess up the filter. So I chose to disable the textbox after it was used for critera.

Thinking on it now, with a little more string manipulation, I could just check to see if the text source was already in the string and remove it... though that could lead to some problems. Will have to think about that.

Anyways, thats the story of how this all began. I am really just looking for something that works for controls in the way me works for forms.
The Anology: ME is to FORMS as ________ is to CONTROLS.
 

Users who are viewing this thread

Back
Top Bottom