theSizz
01-20-2007, 08:06 PM
I want to get the value from FieldA in the previous record of a table and copy it into a new record in the same table, but in a different field named FieldB.
I've put this line of code in the declaration section of a module :
Global gGetNumber As Double
Now in the form that is linked to the table that has the data, I entered in the OnOpen event of the form the followingline of code:
gGetNumber = Me! [txtFieldA]
Now in the OnCurrent event of the same form I entered this code:
If Me.Form.NewRecord = True Then
Me! [txtFieldB] = gGetNumber
End If
The code results in a 0 (zero) being entered in FieldB of the new record, it does not copy the value of FieldA which has a number in it that is not zero.
What am I doing wrong.
Can anyone help me ?
Thanks
I've put this line of code in the declaration section of a module :
Global gGetNumber As Double
Now in the form that is linked to the table that has the data, I entered in the OnOpen event of the form the followingline of code:
gGetNumber = Me! [txtFieldA]
Now in the OnCurrent event of the same form I entered this code:
If Me.Form.NewRecord = True Then
Me! [txtFieldB] = gGetNumber
End If
The code results in a 0 (zero) being entered in FieldB of the new record, it does not copy the value of FieldA which has a number in it that is not zero.
What am I doing wrong.
Can anyone help me ?
Thanks