Copy records

R

renold1958

I have a table called expenses and created a form for
input.

Every now and again, the same expense appears.

Is there a way to copy this by having a Copy Record button
on the form, so the only thing I have to do is to change
the date

Much obliged
 
K

Ken Snell [MVP]

Yes, can be done. How will the form know which previous record is to be
copied?
 
R

renold1958

I have a form where I can enter/edit and search for data
entries. I have a button called "previous" which will
bring me to the record in question, which needs to be
copied
 
K

Ken Snell [MVP]

How about if you just change the Default Value of each control to be the
values that you just entered, and then you can edit the values in each new
record? Sounds as if that will give you what you desire -- to do otherwise
would be a bit trickier code.

For each control on your form, put code similar to this on the AfterUpdate
event of the control:

Private Sub Controlname_AfterUpdate()
Me.Controlname.DefaultValue = """" & Me.Controlname.Value & """"
End Sub
 
Top