Copying value from one textbox to another

Carl Foster

Registered User.
Local time
Today, 23:07
Joined
May 29, 2006
Messages
72
Hi all, I'm hoping there is a simple solution to this one.

To keep it simple, I have a continuous form showing a list of records. I have added an unbound textbox to this list.

I would like to copy the value of one of the fields for each record and paste it into the corresponding unbound textbox. I have tried this code:

Code:
txtJobPrice = txtCustomerPrice

but that simply copies the value of the record that has the focus and pastes it in ALL the unbound textboxes.

Can anybody help me with the code/solution to this problem please?
Thank you for your help if you can.
Carl
 
I'm not sure what you mean by "pasting ALL", did you mean the whole record itself or all of the records' values?

But what I can tell you now is- it's always a good idea to add a Me to all control to explicitly refer to contorls in question.

Code:
Me.txtJobPrice = Me.txtCustomerPrice

I'm thinking you are trying to calculate the costs of jobs and totaling it for a customer. Is that what you are trying to do?
 
I'm thinking you are trying to calculate the costs of jobs and totaling it for a customer. Is that what you are trying to do?

Every job has a set monthly price, but sometimes extra work is done on the job so the price is increased just once.

So, i'm retrieving the set job price, which is "txtCustomerPrice". I don't want to edit that textbox if it is more as that will change the set monthly price for that customer.

So, I want to copy the value into another unbound textbox, "txtJobprice", and then if it needs editing by the user, they can edit it in that textbox. The value will then be entered into a separate Jobs table containing the price of the job.

I'm not sure what you mean by "pasting ALL", did you mean the whole record itself or all of the records' values?

By "pasting ALL" I meant that the unbound textbox was changed for all the records on the continuous form.

I'm going to try the copy and paste methods of the "DoMenuItem" to see if this will do it.
 
Solved

:) Actually, i solved this problem now, thanks.

I created a new calculated field within the query that the form was bound to and used that field as the Job price. As it is a calculated field, it won't update to the table.

Slowly getting there :)
 

Users who are viewing this thread

Back
Top Bottom