Results 1 to 2 of 2
  1. #1
    newcomer333 is offline Novice
    Windows XP Access 2007
    Join Date
    Oct 2010
    Posts
    1

    Thumbs down help in using subform

    1. I have created a table1 with the ID field as the primary key;


    2. I have created another table (called table2) with ID as one the fields;
    3. I have created a one-to-many relationship between the two;
    4. I have created the corresponding input forms (called form1 and form2);
    5. In form1, I have created a command button to call up form2;

    The question is:-
    When I completed in handling the data entry of record N in form1 and pressed the said button, how do I get the content (especially the ID ) of record N of table1 displayed and subsequently be used as inputs for table2?
    At present, the best that I can get is the remains of the data previously inputted in form2!

    Note: Solution using Access 2007 directly (without going too deep into macro/SQL/...) is appreciated from a newbie

    Thanx

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    here's the basic rundown of what you might want to know:

    when you open a 2nd form like that and pass anything to it, you can use more than one method. Some people use "openargs", others just pass it hardcoded.

    the one thing to remember though, is that when you pull the value off of the first form you have to use the control name and not the actual field name that is bound. does that make sense?

    so, for example, if you're opening form #2 from a button, and you want to fill the ID in from the parent record you already have in form #1, the button could would look like this:
    Code:
    docmd.openform "form2"
         forms!form2!IDcontrolName = forms!form1!IDcontrolName
    alternatively, you can use "openargs" (which is part of the docmd.openform method, but to my knowledge you can't populate a new record with anything. It is only used to search for records.

    I could be wrong on that...

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

Similar Threads

  1. Pass Subform filter to subform in report
    By camftm in forum Programming
    Replies: 16
    Last Post: 07-19-2011, 07:12 AM
  2. Data from one subform to anther subform
    By scotribs in forum Forms
    Replies: 3
    Last Post: 03-09-2010, 09:53 AM
  3. Replies: 1
    Last Post: 03-06-2010, 06:30 PM
  4. Replies: 1
    Last Post: 12-10-2005, 04:52 PM
  5. Subform in a Subform and relationships
    By St3ph3n in forum Database Design
    Replies: 3
    Last Post: 12-06-2005, 06:34 PM

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