Duplicating a record, except...

  • Thread starter Thread starter J W Crosby
  • Start date Start date
J

J W Crosby

I have a form based on a table having, say, 20 fields.
I"m viewing the form for someone with all 20 fields
filled. Now, I want to create a new record based on the
current record I'm viewing, carrying over only the "name"
and "teacher" fields to the new record. In other words, I
want to duplicate the current record, but not with all the
fields.

Hope that makes sense!

How do I code it?

Thanks.
 
J W Crosby said:
I have a form based on a table having, say, 20 fields.
I"m viewing the form for someone with all 20 fields
filled. Now, I want to create a new record based on the
current record I'm viewing, carrying over only the "name"
and "teacher" fields to the new record. In other words, I
want to duplicate the current record, but not with all the
fields.

Hope that makes sense!

How do I code it?

Thanks.

Probably the easiest way:

Dim varName As Variant
Dim varTeacher As Variant

varName = Me!txtName.Value
varteacher = Me!cboTeacher.Value
' use your own control names in the above lines.

RunCommand acCmdRecordsGoToNew

Me!txtName = varName
Me!cboTeacher = varTeacher
 
Back
Top