Results 1 to 3 of 3
  1. #1
    MatthewGrace is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    163

    Searching the subform of a subform.

    I have a list of Skids to be shipped in Datasheet view. Each skid has orders on it, displayed in the Expanded Subdatasheet. It looks kinda gawky at the moment, but I'm wondering if there's a simple way to search for stuff in the Subdatasheet.

    Click image for larger version. 

Name:	asdf.jpg 
Views:	12 
Size:	223.4 KB 
ID:	19015

    I came up with something like:



    Code:
    Skids_subform.Form.Filter = "[CustFK] = " & cboSearchCompany.Value
    Skids_subform.Form.FilterOn = True
    Skids_subform.Form.SkidContents_subform.Form.Filter = "[Jobname] = '" & txtSearchJobname.Value & "'"
    Skids_subform.Form.SkidContents_subform.Form.FilterOn = True
    It works... But with a weird hit-or-miss style. Sometimes it works, sometimes it doesn't. If the first two lines of code aren't run, it will never work. I can't even grab the Caption property from the sub of the sub.

    I can't help but wonder if there's a more standard way. Any thoughts appreciated.

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    You have shown us HOW you have done something --form subform subform and sub datasheets. But WHAT is it you're trying to accomplish
    in plain English -- business terms no Access, no database jargon?

  3. #3
    MatthewGrace is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    163
    I'd like to know what kind of code is appropriate for filtering the Subdatasheet directly. I cannot reference it's .filter and .filteron properties, or any property for that matter, without generating an error (see my 4-line code example).

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

Similar Threads

  1. Searching a record through the subform
    By Ruegen in forum Forms
    Replies: 5
    Last Post: 10-28-2013, 09:46 PM
  2. Searching Subform from Mainform Combobox
    By Padstar in forum Access
    Replies: 1
    Last Post: 10-25-2012, 12:45 PM
  3. Searching by field on subform on main form
    By helen21112010 in forum Forms
    Replies: 1
    Last Post: 10-16-2012, 07:55 AM
  4. Searching a Subform
    By desireemm1 in forum Forms
    Replies: 5
    Last Post: 10-03-2011, 06:01 PM
  5. Searching through a subform on a form
    By HarryScofs in forum Access
    Replies: 10
    Last Post: 08-01-2011, 03:37 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