Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    BECCLES, Suffolk, England
    Posts
    407
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Copying data (Office 2000 on WXpHE)

    I realise that this is very basic, but I am not a programmer... therefore help will be much appreciated.
    I have a form called FrmCompanyDataQuery, on that form are two fields: CodAddress1 and CodRegOffAddress1. I wish to copy the data in CodAddress1 to CodRegOffAddress1 when a Yes/No field is checked. I have tried to write a macro to do this but it always falls over.
    <IMG SRC=http://www.wopr.com/w3tuserpics/StephenElms_sig.jpg> Didn't think that I made my first post here on 5th February 2001...!

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

    Re: Copying data (Office 2000 on WXpHE)

    When do you want to do this? Each time the check box is checked, or when the record is saved?

  3. #3
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    BECCLES, Suffolk, England
    Posts
    407
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Copying data (Office 2000 on WXpHE)

    Each time that the box is checked - incidentally, the remaining adress fields would be copied across too; I just mentioned address 1 so I could find out how to do it. Many thanks
    <IMG SRC=http://www.wopr.com/w3tuserpics/StephenElms_sig.jpg> Didn't think that I made my first post here on 5th February 2001...!

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

    Re: Copying data (Office 2000 on WXpHE)

    Do this in VBA. With the check box selected (in design view), activate the Event tab of the Properties window.
    Click in the On Click event, select Event Procedure from the dropdown list and click the builder button (the three dots ... to the right)

    Private Sub YesNoField_Click()
    If Me.[YesNoField] = True Then
    Me.CodRegOffAddress1 = Me.CodAddress1
    End If
    End Sub

    Replace YesNoField by the name of the check box.

Posting Permissions

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