Copy value to another field

Rats

Registered User.
Local time
Tomorrow, 04:43
Joined
Jan 11, 2005
Messages
151
I am building a Access 2k form which will serve as a loan calculator on a project I am doing. I have a field called [amount] which will store the loan value (Principal). Sometimes the user will know the value of [amount] and enter it directly into the field. At other times the value is unknown and will be calculated using a PV function which is conducted in a calculated control called [calcamount]. The user will click on one of four options buttons in an option group to indicate that the [amount] is to be calculated. When the button is pushed I would like to run code similar to the Excel copy/paste function to place the calculated value in the [amount] field.

I can't find a similar function. I have tried, on update me.amount=me.calcamount and if [OptionField]=1 then me.amount=me.calcamount end if, to no avail.

Am I on the right track or should I be doing something else?

Thanks
 
Your code will go in the AfterUpdate event of the OptionGroupFrame:
<<air code>>
Code:
Private Sub OptionGroupFrame_AfterUpdate()

Select Case Me.OptionGroupFrame

Case 1
   '-- Do stuff for the 1st button
Case 2
   '-- Do stuff for the 2nd button
Case 3
   '-- Do stuff for the 3rd button
   '-- If this is your calculated button
   me.amount = me.calcamount 
Case 4
   '-- Do stuff for the 4th button
Case Else
   '-- Probably won't happen
End Select

End Sub
Needless to say, you will have to use the names of your controls.
 
Hey RG thanks for the help. I'll give it a go.
 

Users who are viewing this thread

Back
Top Bottom