Access 2000 field format question

B

bhd50

I am working on an Access 2000 form. One field is a combo box with a default
value of N/A. The second is a text box. Is there a way that will
automatically change the combo box to Yes whenever information is typed into
the text box?
 
A

Allen Browne

You could use the AfterUpdate event procedure of the text box to assign a
value to the combo.

However, I'm not sure it makes sense to store both fields in your table.
Would there ever be cases where the text box could be blank, but the combo
should show Yes? If not, omit the combo's field from your table. You can
still have a text box on your form, with this in its Control Source:
=IIf([Text99] Is Null, "N/a", "Yes")
substituting your text box name for Text99.
This way, it can never be wrong.

If you want to go ahead and store the value using the AfterUpdate event of
the text box anyway, see:
Calculated fields
at:
http://allenbrowne.com/casu-14.html
 
B

bhd50

Excellent feedback. I will use your advice. Thank you very much. You got
me out of a jam.

Allen Browne said:
You could use the AfterUpdate event procedure of the text box to assign a
value to the combo.

However, I'm not sure it makes sense to store both fields in your table.
Would there ever be cases where the text box could be blank, but the combo
should show Yes? If not, omit the combo's field from your table. You can
still have a text box on your form, with this in its Control Source:
=IIf([Text99] Is Null, "N/a", "Yes")
substituting your text box name for Text99.
This way, it can never be wrong.

If you want to go ahead and store the value using the AfterUpdate event of
the text box anyway, see:
Calculated fields
at:
http://allenbrowne.com/casu-14.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

bhd50 said:
I am working on an Access 2000 form. One field is a combo box with a
default
value of N/A. The second is a text box. Is there a way that will
automatically change the combo box to Yes whenever information is typed
into
the text box?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top