Easy . . using a button to paste a value

RichieP

Rock on!
Local time
Today, 19:01
Joined
Apr 16, 2003
Messages
48
Here's an easy one. I know what to do but I'm usure of the wording in Access:

What code should I use on the click event of a button to paste a numeric value from an unbound text box to another field on the same form (the button will be on the same form).

Assume that:

The unbound text box you want to paste from is calledEstimate age

The field you want to paste to is called Age

The button is called paste estimate age

Thanks in advance for any help given.
 
I take it by field you mean "bound textbox" ?



Me.Age = Me.EstimateAge
 
Thanks, that was quick!

Um, another question . . . the age estimate is derived using this code in the control source of the unbound text box (estimate age):

= ([date of application]) - ([date of birth])

These are date fields and to get the result of this to an age I have to set the format of estimate age to yy (this turns it into an age). When I paste this to the bound field age it turns it into some stupidly large number. I changed the age field to yy as well and by just looking at the form it seems to have worked but if I try to get an average of age it reads it as the stupidly large number. So basically, how do I paste it as it the number that is formatted to yy.

(I think the reason that it's a large number is because = ([date of application]) - ([date of birth]) turns it into days and the yy format turns it into years)
 
You shouldn't store the value, just calculate it when required
 

Users who are viewing this thread

Back
Top Bottom