Results 1 to 8 of 8
  1. #1
    sleake is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Sep 2011
    Posts
    51

    Pulll data from another form and write it to a second form's table

    I have a form to enter data on "Partners" with fields for partner name and partner ID. I have a separate Contacts form opened by clicking a button that links "PartnerID" on both forms. I would like to fill in the Partner Name and Partner ID on the Contacts form so the user will not have to select the Partner Name from a combo box on the form. But I need to have this information written to the Contacts table.



    I can get the partner name to display, but not to write to the contacts table: =[Forms]![frm_SFTP_Add_Partner_Profile]![txtSFTPPartnerName], but this is unbound. The Partners form will be open, because it's the only access point to Contacts.

  2. #2
    AlexHedley's Avatar
    AlexHedley is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Location
    England
    Posts
    180

    Pulll data from another form and write it to a second form's table

    You will need it to be bound to the table you want it adding to.

  3. #3
    sleake is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Sep 2011
    Posts
    51
    I guess what I'm asking is whether there is a way, other than a user action, that can enter a value into a bound control from another form?

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Sure:

    Forms!TargetForm.ControlName = Forms!SourceForm.ControlName
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    sleake is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Sep 2011
    Posts
    51
    Thanks for your response. I have this structured with the correct form/control names. First I put it in the Target forms' control source, but received an error. Then I figured out that the control had to be bound, so I changed the source to the field name. Thinking that it needs to be in the Target Forms' events, I tried putting it into the Target Form's On Load and On Current events. (The Target may not be open when the Source forms' After Update event occurs., which I also considered.) Got message that there is an application-defined or object-defned error. As you can see, I'm feeling my way here. Any suggestions?

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Sorry, that was intended to be VBA code after the line opening the second form.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    sleake is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Sep 2011
    Posts
    51
    Well, I got it to work in the Current event of the target form. (all morning! Many name errors) It writes to the table like I wanted. Putting it after the open form line in the button's code generated the same application-defined or object-defned error. So if you say it's OK if it works in the Current event, I not going to fix what's not broken.

    I've been getting lots of errror since I installed 2010 on Saturday, that I'm pulling my hair out! Recompile, recompile, recompile. Now I have one last one with Alan Browne's audit routine that was working before -- something about the object has been renamed or doesn't exist in the Begin audit line, so tht's my next project for the day. I may have to post on that one too. I've check and rechecked table structure and names to no avail so far. Maybe I'll decompile and then recompile to see if that fixes the problem.

    Thank you so much for your help.

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Glad you got it sorted out.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 05-16-2012, 07:46 AM
  2. Write "Edit List Items.." data back to original form.
    By ngahm in forum Database Design
    Replies: 33
    Last Post: 02-27-2012, 06:54 PM
  3. Replies: 9
    Last Post: 05-30-2011, 05:43 PM
  4. Replies: 9
    Last Post: 02-19-2010, 12:07 PM
  5. Parse a File from a Directory and write data to table
    By galahad in forum Database Design
    Replies: 0
    Last Post: 04-23-2009, 08:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums