Z
ZRexRider
I have a sub-form that acts as a continuos form. I want to allow the
user to optionally click a button at the end of the "NEW" row that will
copy some of the previous rows contents.
How do you address the previous row of a continuous form?
Oddly enough, the following works randomly (just to tease me).
Set rs = Me.RecordsetClone
' save the previous position for this continuous form
intPrevPosition = Me.Recordset.AbsolutePosition - 1
If intPrevPosition > 0 Then
' set the current position of the Clone to the form's previous
position
rs.AbsolutePosition = intPrevPosition
' get value of previous position
dblPreviousValue = rs.Fields("mnyAmt").Value
' try to update the form's current row, specific field - works
sometimes
Forms!frmSAP8!frmSubFMZ2.Form!mnyAmt.Value = dblPreviousValue
' original attempt to update the recordset never worked - below
' Me.Recordset.Fields("mnyAmount") = dblPreviousValue
End If
Thanks
user to optionally click a button at the end of the "NEW" row that will
copy some of the previous rows contents.
How do you address the previous row of a continuous form?
Oddly enough, the following works randomly (just to tease me).
Set rs = Me.RecordsetClone
' save the previous position for this continuous form
intPrevPosition = Me.Recordset.AbsolutePosition - 1
If intPrevPosition > 0 Then
' set the current position of the Clone to the form's previous
position
rs.AbsolutePosition = intPrevPosition
' get value of previous position
dblPreviousValue = rs.Fields("mnyAmt").Value
' try to update the form's current row, specific field - works
sometimes
Forms!frmSAP8!frmSubFMZ2.Form!mnyAmt.Value = dblPreviousValue
' original attempt to update the recordset never worked - below
' Me.Recordset.Fields("mnyAmount") = dblPreviousValue
End If
Thanks