Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Mar 2001
    Cheltenham, Gloucestershire, England
    Thanked 0 Times in 0 Posts

    copy contents of fields to another form (2000)

    I need to copy the contents of one field to another when I open a second form - it is not a primary key field so a sub form wont help. The second form has to work on its own so I cannot run it though a query picking up the previous form.

    I appreciate this goes against all normalisation rules, but I need to be able to write to queries using this second form and the original information is more than three tables back.



  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Crystal Beach, FL, Florida, USA
    Thanked 41 Times in 40 Posts

    Re: copy contents of fields to another form (2000)

    Copying information from one form to another is not against normalization rules. It is the existance of the same piece of data (such as a customer name) in more than one place in your data tables that violates the rules.

    There are 2 ways to move info from one form A to form B. You can push it from A, or you can pull it from B.

    If you open B from A, your next line of code in A can set the values of any of B's objects, like this:
    DoCmd.OpenForm "frmB"
    Forms!frmB!someControlName = Forms!frmA!someControlName

    Note that this will work only if B is not opened with acDialog (this freezes A until B is done).

    To "pull" the information into B, put code in B's OnOpen event. It would look to see if A is open; and if it was, it would get its values from A, otherwise it would use its defaults.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

Posting Permissions

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