I have the following function which copies the data from all the fields and pastes to a new record. However I want 2 fields to be ignored, namely Ref and saref
How can I do this please?
thanks
Function CopyRec()
Dim rstcp As DAO.Recordset
Dim rstnew As DAO.Recordset
Dim fieldnum As Integer
Set rstcp = CurrentDb.OpenRecordset("tblactions", dbOpenSnapshot)
Set rstnew = CurrentDb.OpenRecordset("tblactions", dbOpenDynaset)
rstcp.MoveLast
rstnew.AddNew
For fieldnum = 0 To (rstcp.Fields.Count - 1)
rstnew.Fields(fieldnum).Value = rstcp.Fields(fieldnum).Value
Next fieldnum
rstnew.Update
rstcp.close
rstnew.close
End Function
How can I do this please?
thanks
Function CopyRec()
Dim rstcp As DAO.Recordset
Dim rstnew As DAO.Recordset
Dim fieldnum As Integer
Set rstcp = CurrentDb.OpenRecordset("tblactions", dbOpenSnapshot)
Set rstnew = CurrentDb.OpenRecordset("tblactions", dbOpenDynaset)
rstcp.MoveLast
rstnew.AddNew
For fieldnum = 0 To (rstcp.Fields.Count - 1)
rstnew.Fields(fieldnum).Value = rstcp.Fields(fieldnum).Value
Next fieldnum
rstnew.Update
rstcp.close
rstnew.close
End Function