Paste Current Record To New Record - Button

B

Bexar1

I would like a button that would open a new record and paste "some" of the
current records' information. Can this be done? Can this be done naming the
fields to paste instead of copying all the record data?
 
S

Sprinks

Hi, Bexar.

Sure. Copy the values from the current record to variables, move to a new
record, and then assign the variable values to the new record. For example,

Dim varMaterial As Variant
Dim varToday As Variant

varMaterial = Me![Material]
varToday = Me![Today]

DoCmd.GoToRecord , , acNewRec

Me![Material] = varMaterial
Me![Today] = varToday

Hope that helps.
Sprinks
 
B

Bexar1

Thank you very much. It works GREAT!

Sprinks said:
Hi, Bexar.

Sure. Copy the values from the current record to variables, move to a new
record, and then assign the variable values to the new record. For example,

Dim varMaterial As Variant
Dim varToday As Variant

varMaterial = Me![Material]
varToday = Me![Today]

DoCmd.GoToRecord , , acNewRec

Me![Material] = varMaterial
Me![Today] = varToday

Hope that helps.
Sprinks

Bexar1 said:
I would like a button that would open a new record and paste "some" of the
current records' information. Can this be done? Can this be done naming the
fields to paste instead of copying all the record data?
 
Top