Results 1 to 4 of 4
  1. #1
    RonL is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Location
    NJ
    Posts
    114

    simple filtered recordset question

    I just want to confirm that I understand a rudimentary concept. I have a designed one to many relationship between two tables, and placed the corresponding subform within the main form. The main form will have an unbound cboBox from which to choose the foreign key in the "many" table. ie. the subform will automatically show only those records filtered by that cboBox. It will be automatic, because the relation is predefined - ie. implicit - NOT because I have changed the recordsource of the subform in the afterupdate event of the cboBox. (The subform recordsource is defined in design view as unfiltered.). After the mainform is loaded and the value of the cboBox has been chosen (either by code on the initial load - from an "intersession table" which saves the last used parent record -, or by the user subsequently), the recordset for the subform is always the FILTERED one, right?, not the unfiltered one, even though I have never explicitly defined a filtered recordset.



    I ask because I want to manipulate records in the subform using its recordset and the clone thereof, and I want to be sure it contains the records I think it does.

    Thanks, Ron

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    Actually, As you described, but they are both bound.

    the MAIN form IS bound. .. like to a single client
    the subform is for the many records, the client payments.

    The combo would filter the MAIN form and get the 1 client record
    this would automatically filter the subform on the 1 client's MANY payment records.

    If the subform is bound to a payment query BUT linked in the LINKED FIELDS property to the main form.

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,641
    Have you set the Master/Child links properties of the subform container control? This will cause the subform to display only records that are associated with the main form record. The subform RecordsetClone should reflect that.
    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.

  4. #4
    RonL is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Location
    NJ
    Posts
    114
    Quote Originally Posted by June7 View Post
    ?..... The subform RecordsetClone should reflect that.
    Yes master/child set correctly. That last point is what I wanted to confirm, because I think I've been writing unnecessarily complex and superfluous code. Thx June. -Ron

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

Similar Threads

  1. Replies: 1
    Last Post: 07-28-2014, 01:50 PM
  2. If and Else - very simple question
    By tygereye in forum Access
    Replies: 38
    Last Post: 04-02-2014, 06:06 AM
  3. recordset .findfirst question
    By RonL in forum Programming
    Replies: 4
    Last Post: 06-22-2013, 01:12 PM
  4. Replies: 12
    Last Post: 05-30-2013, 02:02 PM
  5. Simple Question I'm sure
    By scarruth2 in forum Access
    Replies: 1
    Last Post: 08-26-2012, 03:07 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