Copy data in form to new record

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??
 
M

Marshall Barton

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top