Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2004
    Posts
    3

    Unanswered: add a <show all> option in query'd combo box

    Hi all,

    I'm using a combo box, populated by a query, to filter records on a form. Is it possible to add an entry to the combo box which will select all records?

  2. #2
    Join Date
    Oct 2003
    Location
    Roanoke, Va
    Posts
    445

    Smile Re: add a <show all> option in query'd combo box

    Originally posted by amadan
    Hi all,

    I'm using a combo box, populated by a query, to filter records on a form. Is it possible to add an entry to the combo box which will select all records?
    "Select 0, "All" from YourTable Union Select Field1, Field2 From YourTable.

    That's the basic version. The number of columns need to match between the literals that you enter and the rest of the data that you want to display. You will have to add code to grab all of whatever it is you are displaying if the selection is 0.

    Hope this helps.

    Gregg

  3. #3
    Join Date
    Feb 2004
    Posts
    3
    Thanks, but I'm still a bit confused wrt the number of columns i need in the expression.

    The source table has 15 columns, 13 of which will be displayed on the form, and only 1 of which is used in the combo box for filtering. Can you advise further?

  4. #4
    Join Date
    Oct 2003
    Location
    Roanoke, Va
    Posts
    445

    Smile

    Originally posted by amadan
    Thanks, but I'm still a bit confused wrt the number of columns i need in the expression.

    The source table has 15 columns, 13 of which will be displayed on the form, and only 1 of which is used in the combo box for filtering. Can you advise further?
    Select "<<All Records>>" from SourceTableName Union Select FieldNameInCombo From SourceTableName".

    Try this in the SQL view of the QBE first to see the results. Union queries can't be depicted in the design view of QBE.

    Gregg

  5. #5
    Join Date
    Feb 2004
    Posts
    3
    Thanks, works perfectly!

  6. #6
    Join Date
    Mar 2004
    Posts
    82

    Combo-box selection to populate form/sf

    Hi,

    I am curious how you get records to be populated on a form and its subforms based on the combo box selection?

    I have a form with a sub-form. The combo box on the main form is a key field and I'd like to have the user be able to select the particular record (on the Main form) for edit purposes. At the moment, I can get the main/sf to populate using the record selector, but not the combo.

    My purpose in this is to enable the form for both new record entry as well as edit of existing records. If I can get it to achieve the simple form scenario described above, I'd like to use the same functionality for more complex forms/sfs that I have. I am just learning VB.

    Thanks,

    Jabo

Posting Permissions

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