Results 1 to 2 of 2
  1. #1
    jugger0s is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2012
    Posts
    1

    Coping ID details from one table to another using Subforms

    Hello, I've been having a problem for quite some time now, I have a database with 3 Tables Each are interlinked to allow a single record to have multiple records linked to it. I also have four Forms that are linked to those tables.

    1 - Main menu - This shows the clients I have
    2 - Client - This is all the address and contact details of the client
    3 - Enquiry - This is the enquiry, there can by multiple enquiries per client
    4 - Action Plan - And there can be multiple action plans per enquiry.

    The problem i have is this, when I have no problem getting into the client form from the main menu I use a macro to open the form from the Main Menu form.

    Code:
     ="[ID]=" & Nz([ID],0)
    Once in the Client form this is where my problem starts. I use the same code in a submenu i have to show all the Enquiries that are linked to that client. I then set the same macro on the submenu and it opens up an already existing enquiry fine. But when i click 'New' or make a new Enquiry it doesn't carry over the 'ID' from the client form to the new created form. I can set it manually but it takes away from it being automated also the people who are going to use it once it's finished are not the most technically minded.

    Is there any way i can add a few lines to the macro to pick up the ID from the client form and copy it over to the new opened form? or is there a way to do it using VBA (I'm a newbie with VBA but will give anything a try to get this to work.)

    I've attached a sample database that I've mocked up to show you what I'm talking about. It's really when i create new records, it won't copy over the ID's...

    thanks alot for your time.
    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    Consider form/subform arrangement.

    Review http://office.microsoft.com/en-us/ac...010098674.aspx
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 7
    Last Post: 07-25-2012, 11:28 AM
  2. Replies: 6
    Last Post: 06-18-2012, 05:11 PM
  3. Replies: 2
    Last Post: 02-11-2012, 09:41 AM
  4. Replies: 1
    Last Post: 03-29-2011, 10:15 AM
  5. Replies: 3
    Last Post: 02-01-2011, 07:15 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