Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Sep 2008
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    button to copy data from field to field (2002)

    I am trying to create a button on a form that will copy the data in a field InqName to a field called Name.

    Doesn't seem that difficult but my attempts have failed.

    Any suggestions

    Thanks.

    Paul

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: button to copy data from field to field (2002)

    Let's say that the button is named cmdCopy.
    Open the form in design view.
    Select the button.
    Activate the Event tab of the Properties window.
    Click in the On Click event.
    Select [Event Procedure] from the dropdown list.
    Click the ... button to the right of the dropdown arrow.
    Make the code look like this:

    Private Sub cmdCopy_Click()
    Me![Name] = Me![InqName]
    End Sub

    Note: I'd give the field Name a different name. "Name" is confusing since it is also a property of many objects. For example, Me.Name is the name of the form, not the Name field.

  3. #3
    Lounger
    Join Date
    Sep 2008
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: button to copy data from field to field (2002)

    Thanks Hans. It worked.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •