Results 1 to 5 of 5
  1. #1
    svcghost is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    38

    Form inside of a form

    I have a form that lets you enter data for multiple players. Each record in the form is for a different player. On each record row there is a button you can press that opens up another form letting you add data for the player's shots (basketball).



    Now when I click this button for a player record, ideally I want it to bring up the inner form that lets you add shot data for THAT PLAYER. When I click it, however, no matter which player record I click it for, it opens the form for the first player on the form. But you can click the next arrow on that form to go to the next record, etc.

    So if I click the shots button for the second player (or third or fourth, etc.) on the main form, it opens up the shots form (in a new window) for the first player. So I manually have to click the next record arrow on that form to enter data for the second player.

    How can I make it so it displays the form for the specfic record you clciked the button for, instead of always the first record? I want to eliminate clicking next ab unch of times in order to find the correct player record, on this inner form.

    Here is an image of the main form, that has the inner form button.



    Here is an image of the inner form window that pops up when you click the shot chart button:


    AS YOU can see, inside the red circle, you can manually scroll to the record you want. But how can I make it so it automatically is for the record I clicked ?


    P.S. I apologize for blanking stuff out. I just am doing my job and don't want to get in trouble releasing anything. I'm not too positive on the policies.

  2. #2
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    A form open is an event, and that event has arguments, of which one is that you can define it to open to a specific record.

    Take a look when in vb help at the docmd method for open form...it will provide the syntax.

    You will want to modify the code that is currently behind that button, to include an argument which identifies the unique record that the user is in when the button is clicked.

    Hope this helps.

  3. #3
    svcghost is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    38
    So I have to edit the onclick function of the button on the main form correct? But what do I add to the onclick event that passes the current record's player id to the subform? That part I just can't get.

  4. #4
    slave138's Avatar
    slave138 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Oct 2010
    Location
    WI
    Posts
    233
    If you use the button wizard to create a button to open a form, there is an option to go to a specific record when you open the new form.

  5. #5
    svcghost is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Sep 2010
    Posts
    38
    Thanks guys!!

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

Similar Threads

  1. Refering to variable form names inside a variable
    By redpetfran in forum Programming
    Replies: 2
    Last Post: 05-21-2010, 01:39 PM
  2. Rounded number inside of text
    By Lockrin in forum Access
    Replies: 6
    Last Post: 01-27-2010, 12:26 PM
  3. Can access have a table view inside a form
    By mossman in forum Access
    Replies: 5
    Last Post: 01-17-2010, 12:19 PM
  4. Replies: 0
    Last Post: 12-14-2009, 09:57 PM
  5. Replies: 1
    Last Post: 08-03-2009, 08:24 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