By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,984 Members | 2,794 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,984 IT Pros & Developers. It's quick & easy.

A text box question: tricky

P: n/a
I have a text box that is bound to a field in a database

1. How do I prevent edit of this field from data entry, but allow a user to
change this by selecting from a combo box?
(the combobox has this field in the control source, and looks up records
from another table)
Right now I do it by disabling the control, but that causes the color to be
grayed out.

What do you suggest?

Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On Tue, 20 Apr 2004 17:10:45 GMT, "Danny" <da********@hotmail.com>
wrote:
I have a text box that is bound to a field in a database

1. How do I prevent edit of this field from data entry, but allow a user to
change this by selecting from a combo box?
(the combobox has this field in the control source, and looks up records
from another table)
Right now I do it by disabling the control, but that causes the color to be
grayed out.

What do you suggest?


1) Leave it as it is.

2) If it isn't going to be edited, don't bind it. Populate the text
box with the value of the field when the form is opened. Change the
value of the text box when the combo box is updated.

3) Enter some code in the control's after update event to restore it
to the value it was before the user attempted to edit it (yuck!)

4) Enter some code in the control's before update event to cancel the
update event. (yuck, but not as bad as (3)

mike
Nov 12 '05 #2

P: n/a
On Tue, 20 Apr 2004 17:10:45 GMT, Danny wrote:
I have a text box that is bound to a field in a database

1. How do I prevent edit of this field from data entry, but allow a user to
change this by selecting from a combo box?
(the combobox has this field in the control source, and looks up records
from another table)
Right now I do it by disabling the control, but that causes the color to be
grayed out.

What do you suggest?


If the only real problem is that the color is grayed out, simply set
the control Locked property to Yes and it's Enabled property to No.
It will retain it's original color but no one can enter it.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 12 '05 #3

P: n/a
Danny wrote:
I have a text box that is bound to a field in a database

1. How do I prevent edit of this field from data entry, but allow a
user to change this by selecting from a combo box?
(the combobox has this field in the control source, and looks up
records from another table)
Right now I do it by disabling the control, but that causes the color
to be grayed out.

What do you suggest?


Simple. Set the Locked property to True as well... then it won't be
greyed out :)

--
regards,

Bradley
Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.