Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2010
    Posts
    3

    Unanswered: Copy Control Field from one form to another...

    I've seen this question asked a few times and no one really seems to give the answer I'm looking for, so here goes.

    I have 2 separate forms, the record ID (auto number) from the first from i want to be able to copy via macro or expression builder and paste to the initial field on the new form. I'm trying to do this without using a subform as there may be many entries per 1 record so I believe that it would be more efficient to do a lookup through a query.

    To make sure my inquiry is clear i want to be able to use copy/paste functions through a macro or expression builder.

    I'm using MS Access 2007, still getting used to some of the changes from 03 to 07 still though.

    Thanks in advance.

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    You wouldn't really use copy/paste. In VBA code:

    Forms!TargetFormName.ControlName = Forms!SourceFormName.ControlName

    In a macro you'd use the SetValue action.
    Paul

  3. #3
    Join Date
    Nov 2010
    Posts
    3
    Well, it's been quite some time since i've actually scripted in VB, i had a copy control set up in a database i set up about 3 years ago (i'm pretty sure it was with a macro) though i was using Access 2003 at the time, and as i stated in my original message i'm still kinda new to the changes made in 07.

  4. #4
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Let me know if you get stuck.
    Paul

  5. #5
    Join Date
    Nov 2010
    Posts
    3
    They've changed the "SetValue" option to "SetProperty" but that was easy enough to figure out. And i think it may be possible that I had previously used a SetValue in my other database but I was also using a subform and not 2 separate forms. Personally i don't see why this seems to be so difficult as we cut/copy/paste all the time, you think microsoft would have thought this out a little better... Worst case scenario i could set up a subform if i really have to but to organize the date i'm looking to have entered it's just not ideal. I simply just want to use copy and paste functions through a macro and it's the one thing Access doesn't seem to want to allow... Sorry for ranting a bit but this is somewhat frustrating.

  6. #6
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    2007 still has the SetValue action; SetProperty is for setting a property, like visible, enabled, etc. I'm not sure what functionality you feel you aren't getting with either the VBA code or SetValue. It will take the contents of one control and copy them to another.
    Paul

Posting Permissions

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