how to automatically copy text from a bound to an unbound control?

pnealen

New member
Local time
Yesterday, 20:06
Joined
Jul 4, 2010
Messages
2
Hello,

I am building a form which has a number of bound text boxes, that receive their values from DLOOKUP functions based upon user selection of a record from a related list box.

When the user selects a database record from the list box, these boxes are automatically populated (via ReQuery functions in a macro) to display 'current street', 'current city', and 'current zip' from the selected record.

I need to create a second set of text boxes ('new street', 'new city', new zip') which are user-editable for the purposes of inputting address changes. I would like these new text boxes to default to the original values automatically, and then be edited if necessary.

It is the automatic defaulting to the original values in conjunction with user-editability which is the problem.

I cannot simply set their 'default value' from the property sheet, as what are the appropriate default values for them is not known until the user selects a record from the list. If I bind the control source of these boxes to the original set, they are not user-editable.

I've tried repainting the form, and a variety of string copy codes, to no avail. I'm guessing that this is not a hard problem, but I am stuck.

Thanks for any hints -
pnealen
 
Pnealen,

Since you seem to be using a macro, have a look at the SetValue action... that should do what you want.
 
Welcome to AWF! :)

There's just one thing that strikes me:
I am building a form which has a number of bound text boxes, that receive their values from DLOOKUP functions based upon user selection of a record from a related list box.
Why are you doing it this way?
 
A bound controlis bound to failed in a table. How can you say you are using dlookups to get the value when it is bound?don't quite understand.
 
Pnealen,

Yes, in my original response, I have just focussed my answer on the specific question you asked.

However, I agree with vbaInet and DCrake, that the concept of using DLooup functions to get data into bound controls on your form appears to indicate another problem with your database structure. If you would like to explore this further, please provide more information about the relevant tables, along with some data examples, to help us further understand what you are trying to achieve.
 

Users who are viewing this thread

Back
Top Bottom