no focus for textbox

eugz

Registered User.
Local time
Today, 18:06
Joined
Aug 31, 2004
Messages
128
Hi All.

I have unbound TextBox in continuous form and I would like that it never get focus. In property I specified Enabled=No and Locked=Yes. But it doesn't help. How to solve that problem?

Thanks.
 
Have you determined how the textbox is getting the focus? ie, is the user simply clicking the control and the form allows the control to gain focus?

Next, is there any code that explicitly set the focus for the textbox, or changes the Enabled / Locked statuses?
 
enabled = no, locked = yes IS definitely a non-interactive text box.

if you can click in it, something is changing the setting.


to test it, try enabled = no, locked = no, which should be greyed out.
 
Hi BigHappyDaddy. Thanks for replay.

I would like when user simply clicking the control it doesn't get a focus.

Thanks.
 
Only for testing purpose, create a new unbound control on the form set it's property to Enabled=No and Locked=Yes, are you able to put focus at that control?
 
The TextBox that I would like no focus has Conditional Formatting rule. When I delete rule that control lost focus. Now problem. How to lost focus and keep Conditional Formatting rule for that control?

Thanks.
 
I believe that in order for Conditional Formatting to work, the control has to have focus. So you may have to do the Conditional Formatting in code in order to avoid giving the control the focus.
 
The last setting in ConditionalFormatting is Enable/Disable.

You need to set it to Disable otherwise the control becomes enabled when the condition is met.
 
Thanks for help.
The decision is simple:
Private Sub MyTextBox_Click()
Me.MyTextBox.Enabled = False
End Sub
 

Users who are viewing this thread

Back
Top Bottom