Results 1 to 4 of 4
  1. #1
    megatronixs is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Posts
    91

    open tab in a form when double click field in subform

    Hi all,



    I have as subform inside a main form that has 2 tabs: "Search" and "Main"
    In the subform I have the search results from the tab "Search". The idea is to open the tab "Main" when I double click.

    I have the below code, but no clue where to get it to open the tab as it is all on the Main form.

    Code:
    Private Sub Account_DblClick(Cancel As Integer)
    Dim stDocName As String
    Dim stLinkCriteria As String
    stDocName = "frm_main_form"
    stLinkCriteria = "[ID]=" & Me![ID]
    DoCmd.OpenForm stDocName, , , stLinkCriteria
    End Sub
    Greetings.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Not sure what you mean by 'open a tab'. You have a subform with a Tab control? You want code to set focus on a tab page called "Main"? If you want to provide db for analysis, follow instructions at bottom of my post.
    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
    megatronixs is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Posts
    91
    Hi June7,
    Yes, that is the idea, to set the focus on the tab control called "Main"

    Greetings.

  4. #4
    megatronixs is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Jul 2015
    Posts
    91
    Hi all,

    I got it solved :-)

    I just added at the end:
    Code:
    Me.Main_tab.SetFocus
    and it sets focus on that tab control :-)

    Greetings.

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

Similar Threads

  1. Replies: 2
    Last Post: 10-29-2014, 03:25 AM
  2. Double click on listbox to open up form
    By EthanMoist in forum Forms
    Replies: 14
    Last Post: 05-21-2013, 02:10 PM
  3. On Double Click Open Form with two criteria
    By AndreasPanayiotou in forum Programming
    Replies: 3
    Last Post: 09-10-2012, 08:47 AM
  4. Replies: 10
    Last Post: 02-20-2012, 11:25 AM
  5. Replies: 7
    Last Post: 01-12-2011, 08:59 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