Results 1 to 3 of 3
  1. #1
    pmontalt is offline Novice
    Windows 8 Access 2013
    Join Date
    Mar 2014
    Posts
    11

    Question Query by value in line item field (datasheet)

    Hello,

    I have a table called CodaTable



    Where the user inputs the system path to a file and associates it with a Sample Bag No.

    Then I have another table and a form for it, TasksDNAAuthentication



    Where the CoDA field is a combobox with the row source:

    Code:
    SELECT [CodaTable].[Coda], [CodaTable].[SampleBagNo] FROM CodaTable WHERE [CodaTable.SampleBagNo] = [Forms]![TasksDNAAuthenticationSubform]![SampleBagNo] ORDER BY [CodaTable].[Coda];
    With this row source, when I open the form the combobox will only filter for the first samplebagno selected, and then every subsequent combobox is then filtering by that same value. Ex: Select combobox for A1002, then select combobox for A1000: it still filters for A1002, giving the wrong result.

    What should the row source code be that filters this CoDA combobox by SampleBagNo per line instead of assigning the first SampleBagNo to the filter variable?

    Thanks.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,898
    Must requery the combobox. Use combobox GotFocus event and code:

    Me.comboboxname.Requery

    Be aware, conditional combobox will not work nice in continuous or datasheet form if the combobox RowSource has a lookup alias.
    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.

  3. #3
    pmontalt is offline Novice
    Windows 8 Access 2013
    Join Date
    Mar 2014
    Posts
    11
    Thanks June7!

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

Similar Threads

  1. Replies: 1
    Last Post: 03-08-2013, 10:29 PM
  2. Replies: 1
    Last Post: 09-15-2012, 08:22 AM
  3. Help generating line item number in order table
    By acenumber5 in forum Queries
    Replies: 18
    Last Post: 08-23-2012, 12:50 PM
  4. Line item query
    By michaeltorpedo in forum Queries
    Replies: 9
    Last Post: 05-02-2012, 01:17 PM
  5. Replies: 4
    Last Post: 07-27-2011, 09:52 AM

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