Results 1 to 6 of 6
  1. #1
    cbrsix is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    215

    Open Subform from another Subform

    Hi,



    Here is my current structure I am working with (I hope it makes sense)

    Main Form: ClientCenter
    ClientCenter, Subform 1: ClientForm
    ClientForm, Subform 1: NewAccount
    ClientForm, Subform 2: ClientFormAccountListSubform

    The ClientCenter has a list of all clients in a list box on the left side of the form and one the right side is the subform ClientForm which populates with the clients information (from the client that was selected in the listbox). The ClientForm has 2 subforms 1) NewAccount (originally only one I had here but I want to change up my process). This subform would have all of the details of an account that is associated with the client that is shown in the ClientForm. Currently I would just toggle between multiple client accounts by using the navigation arrows at the bottom of the form. I don't want to have to do this anymore and want to make it easier for other people to see exactly what is going on. So this brought me to creating another subform, ClientFormAccountListSubform. This form will contain a continuous form that lists a quick view of all accounts that is linked to that client. I then want to click on the account number in the ClientFormAccountListSubform to then show the other subform, NewAccount. I don't want these subforms to open as new tabs/windows. Right now, I have the NewAccount subform hidden. How do I make that subform visible and filter it to show just the account that was clicked on in the ClientFormAccountListSubform.

    This is the code I use to open forms in a new window. How can I apply it my situation?

    Code:
    If Me.Dirty Then 'Save any editsIf Me.Dirty Then 'Save any edits
        Me.Dirty = False
    End If
    If Me.NewRecord Then 'Check these is a record to print
        MsgBox "Select a record to print..."
     Else
        strWhere = " [ClientID] = """ & Me.[ClientID] & """"
        DoCmd.OpenForm "ClientPersonalInformation", acNormal, , strWhere
    End If
    Thanks in advance.
    Last edited by cbrsix; 08-16-2016 at 12:38 PM. Reason: tried to make form structure easier to understand

  2. #2
    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,848

  3. #3
    cbrsix is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    215
    Thank you for those links. However, they do not help me. In the subforms2 link, his control to show the subform is on the main form. My control is on the subform, ClientFormAccountListSubform, which I want to click a button to make visible the filtered (based on which account was selected) subform, NewAccount.

  4. #4
    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,848

  5. #5
    cbrsix is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    215
    Thank you. That link helped. I was able to get it to work.

  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,848

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

Similar Threads

  1. Replies: 8
    Last Post: 11-17-2015, 07:50 PM
  2. Open another form from a subform...
    By DaveWms in forum Access
    Replies: 16
    Last Post: 12-05-2014, 08:18 AM
  3. Replies: 8
    Last Post: 08-09-2013, 09:52 AM
  4. Replies: 1
    Last Post: 11-07-2012, 05:31 PM
  5. Replies: 4
    Last Post: 03-30-2012, 01:47 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