Consulting

Results 1 to 5 of 5

Thread: Transferring data

  1. #1
    VBAX Regular
    Joined
    Nov 2018
    Posts
    41
    Location

    Transferring data

    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.
    Attached Files Attached Files

  2. #2
    VBAX Guru
    Joined
    Mar 2005
    Posts
    3,296
    Location
    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?

  3. #3
    VBAX Regular
    Joined
    Nov 2018
    Posts
    41
    Location
    Quote Originally Posted by OBP View Post
    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.

  4. #4
    VBAX Guru
    Joined
    Mar 2005
    Posts
    3,296
    Location
    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.

  5. #5
    VBAX Regular
    Joined
    Nov 2018
    Posts
    41
    Location
    Quote Originally Posted by OBP View Post
    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!!!!!!!!!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •