Page 2 of 2 FirstFirst 12
Results 16 to 24 of 24
  1. #16
    cyanidem's Avatar
    cyanidem is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Nov 2015
    Location
    Consett, UK
    Posts
    270

    That's why I'd like to see your database, I'm still not sure what you mean by "same transaction form" for example.

  2. #17
    Derrick T. Davidson is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Mar 2013
    Posts
    142
    The data in the database is confidential, I am not allowed to share the information.
    One last try before I exhaust your patience:
    1. The Form transactions has eight subforms
    2. Only one subform is visible on any transaction record opened
    3. After completing some initial information (one combo on the transaction Form makes the relative subForm visible) on the transaction record.
    4. I would like the focus to switch to the open subform ON OPEN THE TRANSACTION FORM and set the focus to the txtbox [trbRate].
    5. The only problem I am experiencing is the code actually moves to the NEXT transaction record with a different subform but it does go to the correct txtbox.
    If this is not clear or you are out of patience I understand and thank you for your time.

  3. #18
    cyanidem's Avatar
    cyanidem is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Nov 2015
    Location
    Consett, UK
    Posts
    270
    I don't need to see your data, only forms, code behind them and sample record in tables. If you could post it that would be helpful. Your explanation may be clear for you but you're the only one that actually can see whole picture.

  4. #19
    Derrick T. Davidson is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Mar 2013
    Posts
    142

    Database attachment

    I made a quick mock up but it will not let me attach it says to big over 500kb even though only three tables and three forms?

  5. #20
    cyanidem's Avatar
    cyanidem is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Nov 2015
    Location
    Consett, UK
    Posts
    270
    1. Database Tools -> Compact and repair database
    2. Zip it

  6. #21
    Derrick T. Davidson is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Mar 2013
    Posts
    142
    It's 11.00pm here in Manila going home now will respond in the morning

  7. #22
    Derrick T. Davidson is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Mar 2013
    Posts
    142

    Mock up of database

    ForCyanidem.zip
    Good morning Sir,
    Attached is a mock up that should explain what is happening and what I want to happen. there are two sub forms on the mock up in my database I have eight larger but similar theory to the attached mock up.

  8. #23
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    First, I'm confused by your use of Text194_Enter() to decide what to do when a selection is made from the TranCat Combobox...normally this would be done in the TranCat_AfterUpdate event.

    That aside, to SetFocus on a Control on a Subform, you need to first SetFocus on the Subform Control, itself, then to the Control on the Subform, using syntax like this:

    Code:
    Me.NameOfSubFormControl.SetFocus
    Me.NameOfSubFormControl.Form!NameOfControl.SetFocus


    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  9. #24
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Steps:
    1) Hide ALL subforms.
    2) Then make one subform visible
    3) Set the focus to the subform
    4) THEN, set the focus to the control

    In your mock up this code works: (Select Case is much cleaner code)
    Code:
    Private Sub AlsoHere_Click()
    
        Me!frmSubBreakdownTransport.Visible = False
        Me!frmSubBreakdownGovernment.Visible = False
    
        Select Case Me!AlsoHere
            Case "Transport"
                Me.frmSubBreakdownTransport.Visible = True
                Me.frmSubBreakdownTransport.SetFocus
                Me.frmSubBreakdownTransport.Form!text36.SetFocus
                'Me.Note.SelText
    
            Case "Government"
                Me!frmSubBreakdownGovernment.Visible = True
                Me!frmSubBreakdownGovernment.SetFocus
                Me!frmSubBreakdownGovernment.Form!text36.SetFocus
    
        End Select
    
    End Sub
    Here is the code from Post #9. (You probably could replace "Forms![frmTransactions]! " with "Me. ")
    Code:
    Private Sub Text194_Enter()
    
        'first hide all sub forms
        Forms![frmTransactions]![frmBreakdownMisc].Visible = False
        Forms![frmTransactions]![frmBreakdownFinance].Visible = False
        Forms![frmTransactions]![frmBreakdownTransport].Visible = False
        Forms![frmTransactions]![frmBreakdownHome].Visible = False
        Forms![frmTransactions]![frmBreakdownGovernment].Visible = False
        Forms![frmTransactions]![frmBreakdownGrocery].Visible = False
        Forms![frmTransactions]![frmBreakdownUtilities].Visible = False
        Forms![frmTransactions]![frmBreakdownDining].Visible = False
    
    
        'now make one visible
        Select Case Me!TranCat
            Case "Misc"
                Forms![frmTransactions]![frmBreakdownMisc].Visible = True
                Forms![frmTransactions]![frmBreakdownMisc].SetFocus
                Forms![frmTransactions]![frmBreakdownMisc].Form![trbRate].SetFocus
            Case "Finance"
                Forms![frmTransactions]![frmBreakdownFinance].Visible = True
                Forms![frmTransactions]![frmBreakdownFinance].SetFocus
                Forms![frmTransactions]![frmBreakdownFinance].Form![trbRate].SetFocus
            Case "Transport"
                Forms![frmTransactions]![frmBreakdownTransport].Visible = True
                Forms![frmTransactions]![frmBreakdownTransport].SetFocus
                Forms![frmTransactions]![frmBreakdownTransport].Form![trbRate].SetFocus
            Case "Home"
                Forms![frmTransactions]![frmBreakdownHome].Visible = True
                Forms![frmTransactions]![frmBreakdownHome].SetFocus
                Forms![frmTransactions]![frmBreakdownHome].Form![trbRate].SetFocus
            Case "Goverment"
                Forms![frmTransactions]![frmBreakdownGovernment].Visible = True
                Forms![frmTransactions]![frmBreakdownGovernment].SetFocus
                Forms![frmTransactions]![frmBreakdownGovernment].Form![trbRate].SetFocus
            Case "Grocery"
                Forms![frmTransactions]![frmBreakdownGrocery].Visible = True
                Forms![frmTransactions]![frmBreakdownGrocery].SetFocus
                Forms![frmTransactions]![frmBreakdownGrocery].Form![trbRate].SetFocus
            Case "Utilities"
                Forms![frmTransactions]![frmBreakdownUtilities].Visible = True
                Forms![frmTransactions]![frmBreakdownUtilities].SetFocus
                Forms![frmTransactions]![frmBreakdownUtilities].Form![trbRate].SetFocus
            Case "Dining"
                Forms![frmTransactions]![frmBreakdownDining].Visible = True
                Forms![frmTransactions]![frmBreakdownDining].SetFocus
                Forms![frmTransactions]![frmBreakdownDining].Form![trbRate].SetFocus
        End Select
    
    End Sub

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Multiple picture change subform focus
    By ZOMB13 in forum Access
    Replies: 7
    Last Post: 04-26-2015, 12:36 AM
  2. Replies: 1
    Last Post: 09-03-2014, 01:36 PM
  3. Replies: 5
    Last Post: 02-20-2014, 11:05 AM
  4. Replies: 5
    Last Post: 09-05-2012, 06:42 PM
  5. multi forms open & focus issue
    By tfulmer in forum Programming
    Replies: 1
    Last Post: 08-23-2011, 04:00 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