Results 1 to 5 of 5
  1. #1
    4 Star Lounger
    Join Date
    Feb 2008
    Location
    United Kingdom
    Posts
    490
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I am trying to query a listbox using the contents of two labels. How do I make the list query if only LB1.Caption has a value or if both LB2 have a value. Thanks

    Rowsource of list:
    SELECT DISTINCT Table1.Directory1, Table1.Directory2, Table1.Directory3, Table1.DocumentName
    FROM Table1
    WHERE (((Table1.Directory1)=[forms]![Newdatabase].[Form].[LB1].[caption])) OR (((Table1.Directory2)=[forms]![Newdatabase].[Form].[LB2].[caption]));

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts
    I'm afraid I don't understand what you are trying to achieve. Captions in general are static and don't change (unless you are changing them in code). What action is your listbox going to perform when it is populated? And how are the captions being set?
    Wendell

  3. #3
    4 Star Lounger
    Join Date
    Feb 2008
    Location
    United Kingdom
    Posts
    490
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sorry for delay. The 2 labels are filled with the selected items of two listboxes, I am then wanting the 3rd listbox to reflect the selections whether 1 or 2 crieria is met. Hope thats clearer, regards

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Please describe explicitely what you want to happen if

    1) both labels have a blank caption
    2) one label has a blank caption and the other a non-blank caption
    3) both labels have a non-blank caption

  5. #5
    4 Star Lounger
    Join Date
    Feb 2008
    Location
    United Kingdom
    Posts
    490
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks Hans. A basic example, each record has three fields in it. The first field will always contain data, fields 2 and 3 have four permutations ie 2 filled 3 empty, 2 empty 3 filled, 2 empty 3 empty, 2 filled 3 filled.

    I am wanting to show records in a list box that correspond to what appears in eventually 2 combo boxes that have a blank position in their items for selection. Hope that is a bit clearer, regards.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •