S
sc
I use the following code to copy data from the previous
record except for two fields:
Private Sub cmdnew_Click()
On Error GoTo Err_cmdnew_Click
DoCmd.GoToRecord , , acNewRec
Exit_cmdnew_Click:
If Me.NewRecord = True Then
Set n = Me.RecordsetClone
n.MoveLast
For i = 0 To n.Fields.Count - 1
If n.Fields(i).Name <> "ForID" And
n.Fields(i).Name <>
"Hour" Then
Me.Controls(n.Fields(i).Name) =
n.Fields(i)
End If
Next
End If
Forms![switch form]![New Articles]![ForFrm]![forqry
subform].Requery
Exit Sub
However, when the user closes the application, a
duplicated data will be save in a new record. If the
user does not make any changes in the current record, can I
clear it out before the user closes the application?
I will appreciate anyone who can give me a code example.
Best regards,
SC
record except for two fields:
Private Sub cmdnew_Click()
On Error GoTo Err_cmdnew_Click
DoCmd.GoToRecord , , acNewRec
Exit_cmdnew_Click:
If Me.NewRecord = True Then
Set n = Me.RecordsetClone
n.MoveLast
For i = 0 To n.Fields.Count - 1
If n.Fields(i).Name <> "ForID" And
n.Fields(i).Name <>
"Hour" Then
Me.Controls(n.Fields(i).Name) =
n.Fields(i)
End If
Next
End If
Forms![switch form]![New Articles]![ForFrm]![forqry
subform].Requery
Exit Sub
However, when the user closes the application, a
duplicated data will be save in a new record. If the
user does not make any changes in the current record, can I
clear it out before the user closes the application?
I will appreciate anyone who can give me a code example.
Best regards,
SC