PDA

View Full Version : Transferring data



Kundan
11-19-2018, 09:55 PM
In the attached DB I want the data of the control named "difference to be transferred to the yellow control immediately on change. Ihave written a code on the "change " event but it is not working. Please guide me.

OBP
11-21-2018, 04:26 AM
I cannot open your database as it is a later version than the one I use.
Are you using the "On Change" Event Procedure of the "difference" field?
And what is the "yellow control"?
Can I ask why you want the "difference" repeated?

Kundan
11-21-2018, 09:17 PM
I cannot open your database as it is a later version than the one I use.
Are you using the "On Change" Event Procedure of the "difference" field?
And what is the "yellow control"?
Can I ask why you want the "difference" repeated?

I have calculated a value in the difference field and I want to store it in a table using the Yellow control. Since the value is calculated through formula and not entered manually the "On Change "event does not work.

OBP
11-22-2018, 02:23 AM
OK, the calculation should be in the VBA and the VBA should go in to the "On Change Events" or "After Update Events" of Fields that are involved in the calculation.
I prefer the After Update event.
ie
you want the difference between fields A & B the VBA should be in both A & B's After Update or On Change Event Procedures so that when a value is entered or changed the Yellow Control gets updated.
You should also place the same code in the Form's "On Current" Event so that any values already entered in A & B are calculated and put in the Yellow control.
Historical data can also be updated using an "Update Query" if required.

Kundan
11-26-2018, 08:33 PM
OK, the calculation should be in the VBA and the VBA should go in to the "On Change Events" or "After Update Events" of Fields that are involved in the calculation.
I prefer the After Update event.
ie
you want the difference between fields A & B the VBA should be in both A & B's After Update or On Change Event Procedures so that when a value is entered or changed the Yellow Control gets updated.
You should also place the same code in the Form's "On Current" Event so that any values already entered in A & B are calculated and put in the Yellow control.
Historical data can also be updated using an "Update Query" if required.



Thanks A lot!!!! GOD BLESS YOU!!!!!!!!!