Results 1 to 4 of 4
  1. #1
    Khalil Handal is offline Competent Performer
    Windows 10 Access 2010 32bit
    Join Date
    Jun 2016
    Posts
    310

    Query Criteria


    Hello,

    A combo box cboSetionType on a form HEADER has a Row Source using a select statement having two field: the primary key and the section value (A, B, C,...). The combo box shows only the section and hides the primary key.

    A second combo box on the DETAIL section has a select statement for the row source. It shows all the records.
    Is it possible to add a criteria so it will show records of a specific section selected from the first combo box in the Header area of the main form?

    I tried the following criteria but was not successful.
    Like [Forms]![frmSections]![cboSectionType]

    frmSections is the name of the form.
    cboSectionType is the name of the combo box on the header area of the form.


    Any ideas?

    Khalil

  2. #2
    Minty is online now VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,158
    This sounds like you need what is often referred to as cascading combo's.
    Paul has a great little guide here http://baldyweb.com/CascadingCombo.htm
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #3
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,938
    Sql to your detail section combo would be something like

    Select Id, description
    From mytable
    Where somefield=[cbosectiontype]

    And in your header combo after update event some code along the lines of

    Mydetailcombo.requery

  4. #4
    Khalil Handal is offline Competent Performer
    Windows 10 Access 2010 32bit
    Join Date
    Jun 2016
    Posts
    310
    Thank you both,
    Managed to get it working

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

Similar Threads

  1. Replies: 4
    Last Post: 12-29-2020, 11:59 AM
  2. Replies: 2
    Last Post: 04-02-2015, 12:45 PM
  3. Replies: 4
    Last Post: 08-30-2014, 10:23 AM
  4. Replies: 5
    Last Post: 08-02-2012, 09:44 AM
  5. Replies: 1
    Last Post: 07-13-2011, 11:00 AM

Tags for this Thread

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