|
-
May 17th, 2005, 01:49 AM
#1
Thread Starter
Addicted Member
[Resolved] how to set value on locked textbox?
hi, is that possible to set a value on a locked textbox?
if yes, could plez show me some example coz i got error when try to set value in to a locked textbox.
if no, what are the alternatives to put value inside a locked control?
Last edited by asmdev; May 21st, 2005 at 05:56 PM.
-
May 17th, 2005, 02:02 AM
#2
Re: how to set value on locked textbox?
In VB, you can put the textbox in a frame, and lock the frame but not the textbox. Not sure if you can do it in VBA, but I think you can.
You can set the enabled property to true on the textbox, and false on the frame so that you can change the text value.
Otherwise, you have to enable it to write to it.
-
May 17th, 2005, 02:38 AM
#3
Thread Starter
Addicted Member
Re: how to set value on locked textbox?
one thing that wonder me is, if i set a textbox locked to true, the access still could update the form? i mean this is unfair, why access could update my locked control while i can't?
-
May 17th, 2005, 03:24 AM
#4
Re: how to set value on locked textbox?
You can lock the control in vb too (I think) but in vba all it means is that the user cannot change what is displayed in it.
Via code you can and if you have bound that textbox to a field, changing it via code will probably be saved.
Problem with bound forms
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
May 21st, 2005, 05:55 PM
#5
Thread Starter
Addicted Member
Re: how to set value on locked textbox?
i found out one tricks 
the first one wouldn't generate any error,
but the second one would generate following error
Run-time error '2185':
You can't reference a property or method for a control unless the
control has the focus.
two of them are set locked = true
hope this would help people who got such similiar problem
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|