Results 1 to 5 of 5
  1. #1
    Keith1714 is offline Novice
    Windows 10 Access 2007
    Join Date
    Jan 2019
    Location
    New Mexico
    Posts
    3

    How do I create a form, sub-form, and sub-subform?

    Main Form= Letter of the alphabet
    Subform = Client Name


    Sub-subform = Detail of Client name

    I am trying to set up a form that has a vertical list of the first letter of client names (no duplicates), a subform of vertical client names, and a sub-subform of client detail. I have a table for each of the forms. I am trying to get a scroll bar to the right side of the form and the sub-form. Currently, I have all three forms linked and the forms display correct information. When the database opens it shows the Main form (Letter only). There is no scroll bar, but has a "+" sign to the left of each letter. I have to click on the "+" of the letter for the names (clicking on the name does nothing) that start with that letter to appear in the sub-form. I then have to click on the "+" sign next to the name to get the sub-subform of clients detail info to appear. I have to click the "-" of the open form to collapse the sub-form. The forms are pushed to the bottom of the screen, as when I click on "W"(or any letter), it shows the link by a connecting arrow to the prior form/sub-form. I would like all forms to always be at the top of the screen (not pushed down), with the main form and the sub-form having the scroll bar. I would also like the all three forms to open when with first client in the table to appear when the database is opened. Thank you for your help.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    you dont need sub-sub-form. just 1 form.
    in main form, single record of client, ALL details.
    you only need a subform to show that 1 clients ownership of many records...1 client has many phones (cell,home,work,etc)
    add subforms for these, not more detail of the master record.

    on the left side, put a list box of the alphabet. (i have a table tAlpha)
    next to that , a listbox of all names (last,first)

    in the AFTERUPDATE of lstAlfa, filter the lstNames,
    user selects the lstName, then that filters the form


    when user selects a Letter in the lstAlpha box, switch the query in the listbox for that letter
    Code:
    Private Sub lstAlpha_AfterUpdate()
    lstNames.RowSource = "qsNamesFilter1"
    End Sub
    SELECT qsNames.* FROM qsNames
    WHERE (((qsNames.Name) Like [Forms]![frmClients]![lstAlpha] & "*"))
    ORDER BY qsNames.Name;

    when user selects a name in the lstNames box, display the 1 record:
    Code:
    Private Sub lstNames_AfterUpdate()
    Me.Filter = "[ClientID] =" & lstNames
    Me.FilterOn = True
    End Sub
    Click image for larger version. 

Name:	clients.jpg 
Views:	13 
Size:	43.7 KB 
ID:	37170

  3. #3
    Keith1714 is offline Novice
    Windows 10 Access 2007
    Join Date
    Jan 2019
    Location
    New Mexico
    Posts
    3
    Ranman256, really do appreciate your help! Everything seems to to work except when I click on the name in the NAME list box. I get the following error: Run Time Error '3075', Syntax Error (comma) in query expression '[Vol Name] = Kent, Clark'. When I take out the comma in the name I get the prompt box to "Enter Parameter Value' Kent.
    Here is my code:

    Private Sub Names_AfterUpdate()
    Me.Filter = "[Vol Name] =" & Names
    Me.FilterOn = True
    End Sub

    "Vol Name" is from my filter query and "Names" is from the Name list box.

  4. #4
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,933
    names is presumably text so you need

    Me.Filter = "[Vol Name] ='" & Names & "'"

  5. #5
    Keith1714 is offline Novice
    Windows 10 Access 2007
    Join Date
    Jan 2019
    Location
    New Mexico
    Posts
    3
    Works great. Done!! Thank you both...Ranman256 and Ajax!

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

Similar Threads

  1. Create a Keypad in an Access form and Subform
    By ramirezx@ddmfg.com in forum Forms
    Replies: 21
    Last Post: 05-12-2018, 04:51 PM
  2. Replies: 13
    Last Post: 03-02-2018, 12:04 PM
  3. Replies: 3
    Last Post: 10-28-2013, 04:39 PM
  4. Replies: 3
    Last Post: 08-04-2012, 10:06 PM
  5. Create combo search form in subform
    By grant.smalley in forum Forms
    Replies: 6
    Last Post: 02-19-2010, 04:37 AM

Tags for this Thread

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