Combining Two Textbox Values into a Third Textbox 
Author Message
 Combining Two Textbox Values into a Third Textbox

I have three text boxes which are bound to three text fields in my database.
The user can directly edit all three text boxes and have the edits written
to the database on pressing the next record button.  But I also want the
third text box to reflect through text combining edits that the user makes
to the first two text boxes.  I see how I can do this through the VBA update
function, but I've just discovered, I think, that I cannot programmatically
change through VBA the contents of the third text box, as it is bound to the
database.  Does this mean then that I need to unbind the third textbox and
then write edits to it to the database via ADO/DAO, or is there a simpler
way to do this?

Regards,
Wayne C.



Tue, 05 Nov 2002 03:00:00 GMT  
 Combining Two Textbox Values into a Third Textbox
Wayne, if I understand this correctly, you want to change the third text box
based on chages to either the first or second, and you want those changes
reflected in the database.

You should be able to use VBA to do that, however, on update might not be the
best place. I think it may get a bit confusing. You could do it - on exit - of
the first and second text box, the user would not see the change in the third
box until he or she exits the first or second. You could do it - on change - but
that happens with every key stroke and might look a bit bizarre. You could do it
- before update - assuming you ALWAYS want to change the third text box based on
the first two, even if the user changed the third text box. And you could make a
"raised label" (which looks like a button) which the user "clicks" to perform
the update. Of course that puts the onus on the user.

In any case, after you make your changes to the third text box, do a me.refresh
to write everything out to the database.

Hope that helps.

Quote:

> I have three text boxes which are bound to three text fields in my database.
> The user can directly edit all three text boxes and have the edits written
> to the database on pressing the next record button.  But I also want the
> third text box to reflect through text combining edits that the user makes
> to the first two text boxes.  I see how I can do this through the VBA update
> function, but I've just discovered, I think, that I cannot programmatically
> change through VBA the contents of the third text box, as it is bound to the
> database.  Does this mean then that I need to unbind the third textbox and
> then write edits to it to the database via ADO/DAO, or is there a simpler
> way to do this?

> Regards,
> Wayne C.



Tue, 05 Nov 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Textbox values based on other textbox values

2. Combine two Form textbox fields prior to writing the record

3. combining text from two textboxes

4. Total textbox values on a form...and have the total appear in another textbox

5. Enable a textbox after entering a value into another textbox

6. doing calculations in hidden textboxes and placing values in visible textboxes in form (Access 2.0)

7. How to get mainform textbox value to transfer to subform textbox

8. Assigning value to textbox if name of textbox is a variable

9. Assigning value to textbox if textbox is a variable name

10. Subtracing the value of two textboxes


 
Powered by phpBB® Forum Software © phpBB Group