Results 1 to 6 of 6
  1. #1
    jlgray0127 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Oct 2011
    Location
    Central Illinois
    Posts
    193

    Filtering Subform

    I have a Main Form: MTP_Workbook_PeriodSchedule.
    There is an unbound text box named Item_Number



    This form has a subform: MTPWorkbookScheduler using a table: MTP_Data_WorkBook_T as the data source.

    What I am trying to do, is filter the text box Item_Number on the subform to equal the text box on the main form (Also Item_Number) when the main form opens.

    I must have tried a 110 different ways to create this filter and can not seem to get it to work.

    Can someone offer me some input here? I have searched 100 different sites and tried 110 different ways to filter this, and just simply can not understand what I am missing.... after 3.5 hours, I am throwing in the towel and asking for help.

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,556
    Just use Link Master and Link Child fields?
    Normally however it would be master form data to subform data.

    However the unbound control is going to be empty on form load until you enter something, so nothing will show on the subform.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    jlgray0127 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Oct 2011
    Location
    Central Illinois
    Posts
    193
    It does not work. I have tried this, and when I try to update the fields in the subform, it will only allow me to update the first record.

    The way this form works, I have a form with a list of parts and other information on it.
    I set the double click property in this form on the Item_Number field to open the Main form and subform in question.
    When the form opens, the unbound text box's value is equal to the text box I double clicked to open this main form and subform.

    The form that opens, the unbound text boxes =form!Mtp_WorkBook_Summary_Frm! "TEXT BOX VALUES" basically giving me the details for the part we are scheduling with a summary of all the demand we need to schedule.
    The subform is the detailed demand by week, and the user needs to input by week how many parts the shop needs to run.

    It's inputting it in a table and doing some calculations to show what the qty they schedule impacts our demand and any buffer inventory we build.

    If I link the subform to the unbound text box, it will let me input into the first record, but when I go to the next record to load a schedule, it goes back to the first record. When I unlink the master and child fields, it works fine.

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,556
    You really should not have control or fieldnames with spaces.
    That is what captions are for.
    When you do, you need to surround them with [ and ].

    I think you need to upload enough for anyone to see the issue.
    If the data is sensitive, then use the code in this thread to obfuscate it.

    Is that next record a new record, or an existing record?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  5. #5
    jojowhite's Avatar
    jojowhite is offline Competent Performer
    Windows 11 Access 2021
    Join Date
    Jan 2025
    Posts
    434
    upload your db so we can analyze it.

  6. #6
    Gustav's Avatar
    Gustav is offline Advanced Beginner
    Windows 11 Office 365
    Join Date
    Jan 2025
    Posts
    32
    It does not work. I have tried this, and when I try to update the fields in the subform, it will only allow me to update the first record.
    Using the Master/Child link fields does work, and being able to update one record only is unrelatated to the filtering.

    So you are facing several issues. Start with resolving the update issue.

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

Similar Threads

  1. Filtering subform from another subform
    By Kipandrews06 in forum Forms
    Replies: 6
    Last Post: 02-14-2022, 06:19 AM
  2. Error with filtering subform using 2 combo boxes
    By dharmacloud in forum Forms
    Replies: 4
    Last Post: 08-22-2011, 10:46 AM
  3. Filtering a subform
    By JvdP in forum Forms
    Replies: 2
    Last Post: 03-16-2011, 08:48 AM
  4. Filtering a Subform
    By swalsh84 in forum Programming
    Replies: 2
    Last Post: 06-23-2010, 10:51 PM
  5. Replies: 0
    Last Post: 08-17-2008, 12:19 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