Duplicate a record from a form, then go to that new record

N

Nicole

I want to duplicate a record, clear out some of the
fields, then go to that record. I can duplicate the
record and clear out some of the fields, no problem, but I
am having trouble going to that new record that was
created. Any suggestions? Thanks in advance!
 
R

Roger Carlson

I don't understand. After you duplicate it and clear out the fields, aren't
you already there? You'll have to explain further. (Using actual form,
table, field, etc names if possible).
 
G

Guest

I have a form that the user doesnt want to have to type
the project number or the date again. So I was going to
copy the record, clear out the feilds that will be
different then go to that new record. However, using the
code below the record doesnt update until I leave it and
come back to the newly duplicated record.

DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 5, ,
acMenuVer70 'Paste Append

Me.Category = " "
Me.UnitAmount = 1
Me.OtherInfo = " "
Me.Notes = " "
 
R

Roger Carlson

Thanks. That helps.

Instead of using the dot (.) try the bang (!). Like this:

Me!Category = " "
Me!UnitAmount = 1
Me!OtherInfo = " "
Me!Notes = " "

This should show the cleared fields, but still leave it unsaved. If you
want the record saved, add this:

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

to the bottom.
 
G

Guest

That all works, Thanks, however, how do I get back to that
record that was just created minus the items I cleared
out. I can see the record duplicated, but it still has
the fields until I leave that record and come back.
 
J

Jim/Chris

I don't know if this is what you want but "Cntl+" will
dulpicate the value in the same field as the prevous record.

Jim
 
R

Roger Carlson

OK, try setting the focus to one of the cleared category fields, like this:
Me.Category = " "
Me.UnitAmount = 1
Me.OtherInfo = " "
Me.Notes = " "
Me.Category.SetFocus

You shouldn't have to move to another record and return.
 

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