Results 1 to 6 of 6
  1. #1
    Syla is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Feb 2020
    Posts
    19

    Form and Subform


    My form shows employee details by their surname. So when you open this form you get asked for a parameter value (surname). I want my subform to show all employees with that surname and when I update it in the form i want the change to show in subform.

  2. #2
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    Do you have two tables? Generally a form/subform arrangement is for two tables with a One-to-Many relationship. The main form shows the ONE table while the subform shows the MANY table.

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    you dont need a subform.
    in a continuous form that shows all employees, enter the name in an unbound text box, then filter the list:

    Code:
    sub txtBox_afterupdate()
    if isNull(txtBox) then
       me.filterOn = false
    else
       me.filter = "[surname]='" & txtBox & "'"
       me.filterOn = true
    endif
    end sub

  4. #4
    Syla is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Feb 2020
    Posts
    19
    I have a form that only shows one employee then i press the next button it shows a different employee - so the form only shows 1 employee each time whereas I want the subform to show all the employees that have the surname 'smith'

  5. #5
    Syla is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Feb 2020
    Posts
    19
    The form is created using a query which is made using many tables

  6. #6
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    Syla, in reply to your last two posts, #4 and 5, Ranman's advice is appropriate. However, a form based on such a query may not be able to update records.

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

Similar Threads

  1. Replies: 11
    Last Post: 03-14-2019, 09:30 PM
  2. Replies: 2
    Last Post: 05-29-2018, 07:39 PM
  3. Replies: 6
    Last Post: 02-11-2018, 02:06 PM
  4. Replies: 3
    Last Post: 06-29-2017, 03:02 PM
  5. Replies: 4
    Last Post: 11-06-2014, 05:35 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