Results 1 to 6 of 6
  1. #1
    d9pierce1 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2012
    Location
    Tennessee
    Posts
    414

    Where clause in rowsource of subform


    MyProfile.zip

    Hi all,
    I started over on a new db (Attached) and ran into an issue with a where statement on a subform. On frmCompany, there are buttons and the one in question is Phone #'s button. I made a quick query for one of the controls on it called Query1 for time being. In any event, i am trying to filter the location combo by the company ID so that only locations that are for that company come up, however, all come up under any company and i cannot figure this out. Have spent all day on this and have tried many versions of where.. and so far i either get nothing or all...
    Frustraiting...

    Thanks
    Dave

  2. #2
    Welshgasman is offline Expert
    Windows 10 Access 2007
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    808
    I cannot get past

    Me.Controls(TabName).BackColor in SwitchTabs ?

    I get 'Object does not support this property or method'?
    Please, please use # when posting code snippets.
    Cross Posting Etiquette: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?search_query=debug+access+vba



  3. #3
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    8,953
    I don't get it. No idea what's bound to Query1 or even if it's relevant. I click the phone button, subform changes, location id combo has list values. No idea what to look for (I mean, what is "all" anyway? 3? 7? 21?). Seems very odd to join 2 fields with those names (locationid and helperid in query1) which doesn't help explain how they're related. I see that company 5 has two locations (id's 1 and 2) and those values show up in tblHelper 13 times, so I'd expect to see 13 combo list items, not the 3 that I get.
    - "doesn't work" doesn't help. Implement changes in copies of your database.
    Iím telling everyone it's good to eat dried grapes. Itís all about raisin awareness.

  4. #4
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    2,429
    Hi Dave,
    Please have a look and let me know if that is what you wanted. Added the criteria to the query and a requery of the combo OnEnter.

    Cheers,
    Vlad
    Attached Files Attached Files
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  5. #5
    d9pierce1 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2012
    Location
    Tennessee
    Posts
    414
    thank you Gicu!
    That was perfect!
    Have a great night....
    Dave

  6. #6
    Welshgasman is offline Expert
    Windows 10 Access 2007
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    808
    Quote Originally Posted by Welshgasman View Post
    I cannot get past

    Me.Controls(TabName).BackColor in SwitchTabs ?

    I get 'Object does not support this property or method'?
    Now I recall that is due to my old version of Access.
    Please, please use # when posting code snippets.
    Cross Posting Etiquette: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?search_query=debug+access+vba



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

Similar Threads

  1. Subform's rowsource does NOT refresh
    By skydivetom in forum Forms
    Replies: 7
    Last Post: 02-18-2021, 05:46 AM
  2. Replies: 2
    Last Post: 07-11-2018, 02:23 AM
  3. Replies: 5
    Last Post: 07-08-2014, 07:47 AM
  4. combobox rowsource per row on a subform
    By kowalski in forum Access
    Replies: 2
    Last Post: 12-05-2012, 01:49 AM
  5. Replies: 2
    Last Post: 09-21-2012, 05:42 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 - Senior Forums