Results 1 to 8 of 8
  1. #1
    tonycl69 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Nov 2012
    Posts
    102

    opening a second form based on the ID from a subform


    Hi all, I have had great help from this site so hoping you can help me again.
    I have a main form and sub form which work fine, the sub form is a continuous form which I want to place a command button on each line that opens another form, of which the table has not been populated yet. I would like the second form to open with the ID of the sub form at a new record, but also open up the list on the second form of previous entries if there are any.

  2. #2
    ranman256's Avatar
    ranman256 is online now VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    Use the Builder to the the path correct.
    but it would look like,(if btn is on subForm)
    Docmd.openForm "myForm",,,"[id]=" & txtID

  3. #3
    tonycl69 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Nov 2012
    Posts
    102
    Hi and thanks, that's not the issue, that would work if I already had entries in the underlying table to the second form, what I want to happen is when I click on the button next to the entry in the first for, for the ID filed to be populated in the second form and also be able to see any previous entries.

  4. #4
    ranman256's Avatar
    ranman256 is online now VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    That needs no button. It's automatic if you bound the sub form to the master form and match the keys.
    just type data in the sub form.

  5. #5
    tonycl69 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Nov 2012
    Posts
    102
    Hi and thanks again, I already have that. I have a main form with a subform, I have a button on the subform that opens a new form, and it's this form I want the ID from the subform entered.

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    What is the database about? remember we know nothing of you or your database or issue.
    What do the Form and subForm represent?
    What is the "other Form"?

    Can you describe the process.. along these lines.
    When I want to see info re:XXX I open the main Form,
    then the related subForm opens and display all the YYYs that relate to the XXX on he main form.
    I need to open a third form in order to display details of WWWW.

  7. #7
    tonycl69 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Nov 2012
    Posts
    102
    Hi guys sorry about the vagueness of the info.
    Right here we go...The database is a service scheduling database, which also tracks vehicle movement, the main form open a second form that in turn opens the transfer/movement form, this is a form with a subform, I then need to open another form from that subform to show any special equipment attached or moved with the vehicle, this was the way I thought it through, but maybe there is a better solution. What is happening is the vehicle movement form is opening correct and showing in the subform all the movements that vehicle has made, but when I open the other form a popup form that does not open with the correct subform ID.

  8. #8
    tonycl69 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Nov 2012
    Posts
    102
    Found the solution, on the 'on current' function I pointed the ID field to the ID field of the subform.

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

Similar Threads

  1. Opening a form based on criteria
    By Jen0dorf in forum Access
    Replies: 3
    Last Post: 08-27-2016, 09:15 AM
  2. Replies: 4
    Last Post: 06-28-2012, 08:01 AM
  3. Replies: 15
    Last Post: 04-17-2012, 01:42 PM
  4. opening a second form from main/subform
    By PJPCVP in forum Database Design
    Replies: 1
    Last Post: 10-29-2010, 09:50 PM
  5. Cancel opening a form based on information
    By eww in forum Programming
    Replies: 1
    Last Post: 10-19-2010, 01:24 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