how can I copy data field from form into data field in table

Rdbui

New member
Local time
Today, 23:32
Joined
Oct 20, 1999
Messages
5
I have table with these field
fieldname1: 'data type number
fieldname2: 'data type number

I creat the form name TESTFORM with "fieldname1" and an unbound control name "result".
After I enter data into "fieldname1". the "result" field give me some value. example: 20
I want to copy a value "20" and paste into fieldname2 in table. I also want the fieldname2 automatic update whenever "result" change.
how can i do it?
thanks


[This message has been edited by Rdbui (edited 11-12-2000).]
 
You shouldn't store a calculated value in a table especially one that can change, use a query instead.
 
Have you tried to enter an event action in the after update event of the result text box on your form This may be an option to pursue after update make the value of the text box avariable then make your table an openrecordset and user the edit update commands to add the variable to the appriprate fields or this event could be generated from a buttons click good luck
and keep me updated
John
 
Thank you for you guys reading my problem and wrote it to me. Be honest I don’t know much about MS access especial about functions code builder... I read the help file in MS access and tried to write this sub function below to do the tast but it won’t work. I think it is not right. I enterd it in an event action in the after update event of the result text box on my form. Can some want help me to write it again and show me how to use it?. Thanks.

Here is my code
Private Sub result_AfterUpdate()
Me.RecordsetClone.Bookmark = Me.Bookmark.result
Me.Bookmark.result = Me.fieldname2
RunCommand acCmdRefresh
End Sub
 

Users who are viewing this thread

Back
Top Bottom