How to Duplicate Record with Lookup Fields

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cjr123
    New Member
    • Nov 2013
    • 4

    #1

    How to Duplicate Record with Lookup Fields

    I want to have a button on a form to Duplicate a record. Not all of the fields would be duplicated. The code works until I use the fields that are Lookup Fields. I am not sure how to type the names of the fields to reference the correct field name. In the code, the Region, Class and Seller all come from a Lookup. My code is as follows:
    Code:
    Private Sub DuplicateRecord_Click()
        With Me.RecordsetClone
        .AddNew
                !Region = Region
                !Class = Class
                !Seller = Seller
                !Description = Description
        .Update
            Me.Bookmark = .LastModified
        End With
    End Sub
    Can anyone give me an idea how to write the lookup field names?
Working...