PC Review


Reply
Thread Tools Rate Thread

bound text box

 
 
kcrad
Guest
Posts: n/a
 
      27th Jan 2009
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!
 
Reply With Quote
 
 
 
 
Dirk Goldgar
Guest
Posts: n/a
 
      27th Jan 2009
"kcrad" <(E-Mail Removed)> wrote in message
news:B6A516EE-A35F-4125-B979-(E-Mail Removed)...
> 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?

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
bound text box =?Utf-8?B?YmlnIHQ=?= Microsoft Access Forms 3 20th Mar 2007 03:30 PM
Bound Text =?Utf-8?B?cm9i?= Microsoft Access Form Coding 1 6th Apr 2005 08:00 PM
Bound Form needs field1 Average disp. by field1 Bound Text box website designer via AccessMonster.com Microsoft Access Form Coding 1 22nd Dec 2004 11:59 AM
Changing a text boxes value (from code) of a data bound text box does not work Joshua Ellul Microsoft ADO .NET 2 17th Oct 2003 01:03 AM
Changing a text boxes value (from code) of a data bound text box does not work Joshua Ellul Microsoft Dot NET 0 15th Oct 2003 06:27 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:42 AM.