Is it possible to duplicate the contents of a form with just one
buttonclick?
My database exists of records with just minor changes. Now I have to copy
and paste every field. So it would be great if al the fiels could be copied
in the new record.
Please mail your reply, because I won't be able to read this news group this
week-end.
Thanx in advance,
Dirk Dulfer
I have a "clone" button on one of my forms. In the code behind the button, I
execute the commands (IIRC) to (1) select the current record, (2) copy the
selection to the clipboard, (3) go to a new record, (4) select the new record,
and (5) paste from the clipboard. This may not be exactly right -- I haven't
looked at the code recently -- but it's the general idea.
Dirk Goldgar
(please direct email replies to <di...@NOSPAMagcsys.com>)
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Function AutoFillNewRecord(F As Form)
Dim RS As Recordset, C As Control
Dim FillFields As String, FillAllFields As Integer
On Error Resume Next
' Exit if not on the new record.
If Not F.NewRecord Then Exit Function
' Goto the last record of the form recordset (to autofill form)
Set RS = F.RecordsetClone
RS.MoveLast
' Exit if you cannot move to the last record (no records).
If Err <> 0 Then Exit Function
F.Painting = False
' Visit each field on the form.
For Each C In F
If C.Tag = "retain" Then
C = RS(C.ControlSource)
End If
Next
F.Painting = True
End Function
Dirk Dulfer wrote in message <7bomr1$8u9$2...@news2.xs4all.nl>...