Results 1 to 3 of 3
  1. #1
    ForumUser is offline Novice
    Windows 10 Access 2013
    Join Date
    Jan 2016
    Posts
    4

    open record from subforms

    Hi,



    I have a main form where I see some search results, below that I have two subforms in a tab. I want to use one button to open a record from the main form, or from one the subforms which I placed in a tab.
    The search results are shown in the main form. The search records in the main form have nothing to do with records in the subforms. So this subforms are not linked to the main form.
    I have the vba code to open the record from the main form, but I don't know the vba code to open a record from one of the subforms in a new form when clicked on the button.
    Three buttons for main form, subform 1 and subform 2 are also good. This is button is in the form footer.

    Thanks for the help!
    Last edited by ForumUser; 01-08-2016 at 03:00 PM.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    You want one button to serve for opening a record selected in either the main or subform? How should the code know which to reference? I suspect you need 3 buttons.

    One on main form to open that record. One on each of the subforms.
    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.

  3. #3
    ForumUser is offline Novice
    Windows 10 Access 2013
    Join Date
    Jan 2016
    Posts
    4
    Alright, thats also fine. I already have a button to open the record from the main form. Now the subforms, the link between both subforms and opening form is ID

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

Similar Threads

  1. Replies: 6
    Last Post: 02-15-2015, 11:51 AM
  2. Replies: 2
    Last Post: 09-17-2014, 04:55 PM
  3. Replies: 24
    Last Post: 03-04-2013, 06:15 PM
  4. Replies: 1
    Last Post: 11-21-2012, 03:41 PM
  5. Replies: 4
    Last Post: 03-30-2012, 09:45 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