Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

--- Duplicating form in next record ---

0 views
Skip to first unread message

Dirk Dulfer

unread,
Mar 5, 1999, 3:00:00 AM3/5/99
to
Hello there,

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


dgol...@my-dejanews.com

unread,
Mar 5, 1999, 3:00:00 AM3/5/99
to con...@rem-reclame.nl
In article <7bomr1$8u9$2...@news2.xs4all.nl>,

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

Phil Shields

unread,
Mar 5, 1999, 3:00:00 AM3/5/99
to
I call this function from the on current event of a form. Any control on
the form that has a tag of "retain" for a new record will have a value equal
to the previous record.
Phil

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>...

0 new messages