Add value to existing record

mhermher

New member
Local time
Yesterday, 21:41
Joined
Sep 19, 2009
Messages
8
Hi,

I have a table with fieldA fieldB and fieldC, lets say.
I have a query which refers to that table with fieldA field B fieldX and fieldZ, lets say.
I have a form which has that query as my record source.

On that form, I have an unbound text box and a command button.
What I would like to do is have the user be able to fill in the text box, press the button and have that value added to fieldC of the original table based on the current record of the form, which includes the original FieldA from the table (through the query).

Does that make sense? I have tried searching online but can't find anything that specifically addresses this situation. I assume that I will need some VBA. I have found some code that would allow me to create a NEW record in a table and add values from unbound boxes, but none which ADDs to an existing record in a table. Thanks in advance for any help.

Mher
 
Just do something like this:

[FieldA] = [FieldA] + txtBox1.Value
 
No. You must have misunderstood. When I say add, I'm not talking about arithmetic. I want to add more information to that record, as in enter a value for another field.
 
Hi,

Thank you for trying to help me with my problem, but again, I think you misunderstood me. I am not trying to be rude, and I really appreciate the effort.

If I understand it right, you're code would concatenate the value in the text box to my value in fieldA. I do not want to change the value in fieldA, I want to place the value in the textbox into fieldC. The problem is fieldC is not on my form, it is not in the query which is the record source for the form. I am still pretty new at this, so if I am explaining the problem wrong, please try to help me explain it better. Thanks.
 
There's no reason why you shouldn't include FieldC in your query. Include it in your query and set the value of that textbox to [FieldC].

[FieldC] = txtbox1.Value
 

Users who are viewing this thread

Back
Top Bottom