A family of Microsoft relational database management systems designed for ease of use.
Am I right in thinking that what you are attempting is to create a new record in which selected fields have the values of those fields in the current record? If so I'd suggest a different approach, setting the DefaultValue property of the relevant controls. If we assume you want to copy the FirstName and LastName values only for instance, the button's code would be:
Private Sub cmdCopyRecord_Click()
' set default values of controls to be copied
' to values in current record
Me.FirstName.DefaultValue = """" & Me.FirstName & """"
Me.LastName.DefaultValue = """" & Me.LastName & """"
' move form to a new record
DoCmd.GoToRecord acForm, Me.Name, acNewRec
' initiate a new record by setting the value of any
' non-Null control to itself
Me.FirstName = Me.FirstName
' set default values of relevant controls
' back to zero-length strings
Me.FirstName.DefaultValue = """"""
Me.LastName.DefaultValue = """"""
End Sub
A few explanatory points:
1. The DefaultValue property is always a string expression, so should be wrapped in literal quotes characters as above regardless of the data type of the field in question.
2. The reason for there being so many quotes characters is that, when building a string expression a literal double quotes character is represented by a contiguous pair of double quotes characters. This is better than using single quote characters, particularly with personal names, as the value might include an apostrophe, whereas a double quotes character within the value is far less likely.
3. Note that to initiate the new record after setting the default values you only have to set the value of one of the controls to itself, not all of them. This 'dirties' the form, so the default values become the actual values of the controls, and the record will be saved even if the user does not add any more data or edit any of the default values.
4. Note that I've given the button a meaningful name rather than accepting the name Access gives it. Do this as soon as a button, or any type of control, is added to a form, before entering any code in one of its event procedures.