bound text box

K

kcrad

Strange question here ...

I have a text box on a form that is populated by text from two different
sources. I set it up with the following code in the control source:

=DLookUp("MTHDcomment","MTHDtbl","MTHDmnemonic = Combo26.value") & " " &
Text28.Value

The code works perfectly - my problem is that now I have no way to bind the
contents of this text box to a table. What I'm trying to do is pull together
a canned comment (chosen by picking a mnemonic from a combo box) plus a free
text comment (typed in by the user). I then want to save the resulting text
to a field in a table but since I had to write the code in the text box
control source I have no way to bind the box to the table.

Does anyone know another way to get the combined text into a table?

Thanks!
 
D

Dirk Goldgar

kcrad said:
Strange question here ...

I have a text box on a form that is populated by text from two different
sources. I set it up with the following code in the control source:

=DLookUp("MTHDcomment","MTHDtbl","MTHDmnemonic = Combo26.value") & " " &
Text28.Value

The code works perfectly - my problem is that now I have no way to bind
the
contents of this text box to a table. What I'm trying to do is pull
together
a canned comment (chosen by picking a mnemonic from a combo box) plus a
free
text comment (typed in by the user). I then want to save the resulting
text
to a field in a table but since I had to write the code in the text box
control source I have no way to bind the box to the table.

Does anyone know another way to get the combined text into a table?


It is possible, in a roundabout way, but it is usually a bad idea. Are
Combo26 and Text28 bound controls, so that their values are stored in the
table? If so, there is no good reason to store the calculated value that
you get from your expression, because you can re-calculate is any time you
need it. Conversely, if you do store the calculated value, then you run the
risk of someone, some time, coming along and changing one or more of these
three values without changing the others. Then you would have inconsistent
data stored in your table.

*If* -- and it's a big "if" -- you need to store the value as it is
calculated *now*, and don't want it to change if one of the base values
changes, then you may want to store the calculated value. But that is a
special circumstance. Does it apply in your case?
 

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