Solved TextBox Issue (1 Viewer)

mfaisal.ce

Member
Local time
Today, 18:11
Joined
Dec 21, 2020
Messages
76
Hello Friends,

I want to disable textbox edit in msaccess, i did it by using its property Locked= True but i want that even focus doesnot go to textbox like Labels....

my purpose is to make the textbox locked, visible and even can not be mouse clicked......

guide me plz....
 

isladogs

MVP / VIP
Local time
Today, 15:11
Joined
Jan 14, 2017
Messages
18,186
Disable it instead of locking it...or if you prefer do both.
Either will do what you want but the appearance will differ slightly.
 

mfaisal.ce

Member
Local time
Today, 18:11
Joined
Dec 21, 2020
Messages
76
thanks dear....
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 11:11
Joined
May 21, 2018
Messages
8,463
but the appearance will differ slightly.
If you do not want the appearance to be different, I often
1. Lock the item
2. Set it to no tab stops so you cannot tab into it
3. Set the on focus to move it somewhere else.
This gives the same effect without the difference in appearance

@isladogs,
Can you override the "greyed out" appearance? I thought in previous versions of access you code. I cannot seem to now.
 

isladogs

MVP / VIP
Local time
Today, 15:11
Joined
Jan 14, 2017
Messages
18,186
@isladogs,
Can you override the "greyed out" appearance? I thought in previous versions of access you code. I cannot seem to now.

That's an interesting question and the answer depends on the control type
As you would expect, disabling any control makes them 'greyed out' (except for subforms), locking them does not cause 'grey out' .
However if you both lock & disable controls, some remain greyed out whilst others don't. I have no idea why

1610822012155.png


I modified my existing SetControls app to demonstrate this. See attached
 

Attachments

  • GreyedOutControls.zip
    77.7 KB · Views: 92
Last edited:

Users who are viewing this thread

Top Bottom