ASKER
Me.Requery
ASKER
ASKER
With fld
If .Attributes And dbAutoIncrField Then
' Skip Autonumber or GUID field.
ElseIf .Name = "Qtr" Then
' Pick user selected value from unbound textbox named, say, NewQtr.
.Value = Nz(Me!NewQtr.Value, 0)
ElseIf .Name = "SomeOtherField" Then
' Insert other value.
.Value = SomeOtherValue
Else
' Copy field.
.Value = rst.Fields(.Name).Value
End If
End With
lngID = me.txt_ID
strSQL = "INSERT INTO yourTable (Field2, Field3, Field4,..., FieldN) " _
& "SELECT Field2, Field3, Field4,...FieldN " _
& "FROM yourTable WHERE ID = " & me.txt_ID
currentdb.execute strsql, dbfailonerror
me.requery
Then, you could add some additional code to go to determine the ID value associated with that new record, and set the focus to the copy.ASKER
ASKER
ASKER
Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.
TRUSTED BY
An example is here:
How do I write VBA code to duplicate a record