We help IT Professionals succeed at work.

Lock textbox from data entry

Bob Stamm
Bob Stamm asked
on
Medium Priority
1,241 Views
Last Modified: 2008-02-20
I have a access form with a textbox placed on it for a date field.  On dbl click I have code that fills in this textbox with the proper date.  All is well!!  My problem is that some users attempt to keyin the information without dbl clicking the textbox.  How can I eliminate this from happening.  I must be overlooking something as I assume this should be easy.

Ideas?
Thanks,
Bob
Comment
Watch Question

Commented:
Hi RobertStamm,
Me.myTextBox.Enabled = False
Dave :-)

Commented:
Hang on.. This wont work.. On the double click event of the textbox you are firing this?
Dave
Bob StammOperations Manager

Author

Commented:
Yes.  If I enable = false, I cant double click.
Database Developer
CERTIFIED EXPERT
Commented:
Not that Dave isn't right.. :-)

But you might have an easier life with
Me.myTextBox.Locaked = False

With Enabled - if you're setting it to False you'll have to setfocus to another control first (or it'll fail naturally - a disabled control can't have the focus).
Also - if you're wanting to double click it - it being disabled that event won't then fire. :-S

But it depends on the result you're after.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Leigh PurvisDatabase Developer
CERTIFIED EXPERT

Commented:
lol oh curse you all for typing while I was lol

Bob StammOperations Manager

Author

Commented:
Locking the textbox was the solution for me!  
Thanks for the help.
Bob
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.