Copy data in form to new record

  • Thread starter Thread starter Jerry
  • Start date Start date
J

Jerry

I have a data entry form that has Order # and Item # as
the index. If adding a new record and that order index
already exists, I want the user to be able to copy the
data to a new record. I want to add the Item # as Item # +
1 and set some fields as null. I found where they could
click Select Record from the toolbar, click copy, go to
new record and click paste. But they'd have to manually
change the fields. I'd rather have code that does this
with the click of a button but I can't figure it out. Can
someone help please??
 
Jerry said:
I have a data entry form that has Order # and Item # as
the index. If adding a new record and that order index
already exists, I want the user to be able to copy the
data to a new record. I want to add the Item # as Item # +
1 and set some fields as null. I found where they could
click Select Record from the toolbar, click copy, go to
new record and click paste. But they'd have to manually
change the fields. I'd rather have code that does this
with the click of a button but I can't figure it out.

I prefer this general approach:

With Me.RecordsetClone
.AddNew
!fielda = Me.fielda
!fieldb = somevalue
!fieldc = Me.Mieldc
!field = Null
. . .
.Update
Me.Bookmark = .LastModified
End With
 
Back
Top