Transferring Data From One Field To Another On Same Table.

IanDuk

New member
Local time
Today, 10:46
Joined
Aug 20, 2019
Messages
8
Help Please!

I am trying to do a Rota Application and need to copy data between two fields on a sub form.

I have a calculated field called Hours and want to copy that value over to HoursAdj incase there are any adjustments that need making.

I have tried a number of things on the AfterUpdate but to no avail.

Many thanks in advance.
 
Hi Ian. Welcome to AWF! How exactly are you trying to do it and where? Was it something like this?
Code:
Me.HoursAdj=Me.Hours
 
Hi theDBguy

Yes that is one method I have tried but the data is not changing?
 
Hi theDBguy

Yes that is one method I have tried but the data is not changing?
Hi. Do you know if the code is actually executing? That's why I asked where you're trying to use this code. I mean, which event are you using to run it?
 
The code is programmed into the AfterUpdate on the Hours field.
 
The code is programmed into the AfterUpdate on the Hours field.
I see. Did you try stepping through the code to make sure it is running and the value you expect is what you're getting?
 
I have and I have debugged it?
This is the exact code.

Private Sub DjRotaDetail_Hours_AfterUpdate()

Me.DjRotaDetail_HrsAdj = Me.DjRotaDetail_Hours


End Sub
 
I have and I have debugged it?
This is the exact code.

Private Sub DjRotaDetail_Hours_AfterUpdate()

Me.DjRotaDetail_HrsAdj = Me.DjRotaDetail_Hours


End Sub
So, were you getting the correct value when you debug?
 
Cracked it! It should have been on the After Update on the end time before the Hours Calculation took place.
 

Users who are viewing this thread

Back
Top Bottom