Results 1 to 8 of 8
  1. #1
    TAM is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2015
    Posts
    22

    Coaching Requested on Setting up a Form

    I am new to Access and need to create a form with a subform. There will be a combo box linked to another file containing client IDs. When the client ID is selected, it needs to pull those record(s) for the client selected. I'm seeking to understand the following:


    1) Is this a form with the combo box in the header?
    2) How do I link the client ID from the header to the subform.
    3) Is the data entry section in blue one subform and then I create a 2nd subform as a table? If so, how do I link all 3 client ID fields? or is it one form using a split form?
    Click image for larger version. 

Name:	Access Q2.png 
Views:	25 
Size:	24.5 KB 
ID:	20847

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    The form is a single record view of 1 client.
    The subform is linked to the master field CLIENT#, so you only see THAT master Client Id's records.

    the combo is unbound in the header, in the afterUpdate event
    the combo will filter the 1 clientID

    Code:
    sub cboFind_afterupdate()
        me.filter = "[client#] = " & cboFind
        me.filterOn = true
    end sub

  3. #3
    TAM is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2015
    Posts
    22
    Thanks. I'm a novice and I'm building all of these forms using the wizard.

    So, let me go through the steps based on what you have above:
    1) Create a Form with an unbound field for the client ID.
    2) Add a subform to get the table layout view
    3) Add another subform to get the form layout view

    in the Form, I will put the code you have which will filter on client ID. I'm still stuck on whether I need to create two subforms or one. If it's two, how do I link both subforms to the header input?

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Exactly what tables are involved?

    Review
    https://support.office.com/en-us/art...8-C266FE084102
    http://www.allenbrowne.com/ser-62.html

    If only one table then a single form set for Continuous view can be used. Data controls can be arranged to look like Datasheet. Filter controls in header section.
    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.

  5. #5
    TAM is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2015
    Posts
    22
    Quote Originally Posted by June7 View Post
    Exactly what tables are involved?

    Review
    https://support.office.com/en-us/art...8-C266FE084102
    http://www.allenbrowne.com/ser-62.html

    If only one table then a single form set for Continuous view can be used. Data controls can be arranged to look like Datasheet. Filter controls in header section.
    Two tables:
    Table #1: A unique list of IDs. This would be used for the combo box.
    Table #2: A table which has multiple records per ID

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    So which option do you want to try?

    The single form approach would bind form to Table 2 with unbound combobox in header listing IDs from Table 1.

    A form/subform approach would have main form bound to Table 1 with the unbound combobox in its header. Subform bound to Table 2 would be linked to main form. Only associated records will display in subform. Use code behind main form to find desired ID record.
    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.

  7. #7
    TAM is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2015
    Posts
    22
    Quote Originally Posted by June7 View Post
    So which option do you want to try?

    The single form approach would bind form to Table 2 with unbound combobox in header listing IDs from Table 1.

    A form/subform approach would have main form bound to Table 1 with the unbound combobox in its header. Subform bound to Table 2 would be linked to main form. Only associated records will display in subform. Use code behind main form to find desired ID record.
    The form/sub form, please and using the Wizards. Thank you!

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    And how did that go? I never use the Wizards.
    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.

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

Similar Threads

  1. VBA Help Requested
    By aamer in forum Access
    Replies: 1
    Last Post: 06-08-2014, 08:51 AM
  2. The requested member of the collection does not exist.
    By murfeezlaw in forum Programming
    Replies: 2
    Last Post: 07-12-2013, 07:24 AM
  3. Replies: 4
    Last Post: 01-18-2013, 02:41 PM
  4. VBA Help Requested
    By aamer in forum Access
    Replies: 7
    Last Post: 03-07-2012, 02:14 PM
  5. Help requested for calculating age
    By techexpressinc in forum Queries
    Replies: 3
    Last Post: 01-28-2009, 11:29 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