Results 1 to 4 of 4
  1. #1
    mishash is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2017
    Posts
    4

    Limit unbound filter (combobox) only to the values available in the form

    My form Deals is based on query, lists securities' buy/sell deals and includes SecurityName, SecuritySymbol, DateOfDeal, PriceOfDeal etc.
    The forms opens from another form Clients bearing the client name filter (it contains only the deals of the client, chosen in the Clients form), so it has subform with records of the deals and mainform which inherits the client name.
    In the Deals subform I have an unbound combo-box SelectSymbol, which filters the form by selected security' deals.

    SELECT [SecurityDetails].SecurityName, [SecurityDetails].SelectSymbol
    FROM [SecurityDetails]
    ORDER BY [SecurityDetails].SecuritySymbol;



    Private Sub SelectSymbol_AfterUpdate()
    Me.Filter = "SecurityName= '" & Me!SelectSymbol& "'"
    Me.FilterOn = True
    End Sub

    The combobox, naturally, lists all the securities there are in the DB (thousands of records).
    I would like to limit it to only the securities which are available int the current form Deals, shown for the chosen client (tens of records).
    Tried to put criteria [Forms]![Deals ]![DealsSubform].[Form]![SecuritySymbol] in the combobox' Row Sours, but it limits the combobox list only to the 1st record.

    Please help.

  2. #2
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    I'd suggest creating a text box somewhere on the form (invisible) showing the security symbol

    Then add where [securitydetails].security symbol = me.nameoftextbox to the rowsource of the combobox


    Sent from my iPhone using Tapatalk

  3. #3
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    In the query for the combobox, put in the criteria of the field "=Forms!mainformname!Client" (without the quotes). Then in the AfterUpdate of the client in the main form requery the combobox (Me!subformname!comboboxname.Requery)

  4. #4
    mishash is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2017
    Posts
    4
    Thanks Andy!

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

Similar Threads

  1. Replies: 3
    Last Post: 03-02-2016, 06:05 PM
  2. Replies: 19
    Last Post: 09-09-2014, 01:36 AM
  3. Unbound Combobox Filter By Date Criteria
    By burrina in forum Forms
    Replies: 8
    Last Post: 01-04-2013, 02:24 PM
  4. Replies: 16
    Last Post: 10-13-2011, 07:52 AM
  5. Replies: 0
    Last Post: 08-24-2010, 06:38 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