• Copying across data from one field to another …

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Copying across data from one field to another …

    • This topic has 1 reply, 2 voices, and was last updated 24 years ago.
    Author
    Topic
    #1769238

    Hi All

    I’m trying to copy across data between fields on a form when I click a button. The code I’m using is:

    Private Sub butCopyDetails_Click()
    corAddress1 = address1
    corAddress2 = address2
    corAddress3 = address3
    corTown = town
    corPostCode = postcode
    corTel = tel
    corFax = fax
    corEmail = email
    corwww = www
    End Sub

    It works … partly … but for some reason it only shows the data in the new fields once I’ve moved onto a new record and then moved back again. Is there anyway I can solve this e.g. by adding in code that refreshes the fields straight away? I’m confused!

    Cheers,
    Kenny.

    Viewing 0 reply threads
    Author
    Replies
    • #1782649

      Yes, Kenny. Look in Help for Refresh, Requery and Repaint. You place them before the End Sub. It would look something like this:

      corwww = www
      Me.Refresh
      Me.Repaint
      End Sub

      You may have to play with it a little, but it should work. (Of course, Charlotte probably has a better way. heart)

    Viewing 0 reply threads
    Reply To: Copying across data from one field to another …

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: