Results 1 to 13 of 13
  1. #1
    Join Date
    Mar 2004
    Posts
    287

    Unanswered: Adding ALL to combo box

    I have tried many links on the web to do this but can't seem to get this working...

    Here's my dilema;

    I have a combobox named cboStatus which is a Table/Query linked to 'comboobjectives' query

    My 'comboobjectives' looks like this;
    SELECT CompStatus, CompStatus FROM TBL_Objectives UNION SELECT "(All)" AS Tom, Null AS M FROM TBL_Objectives;


    I want it to display the CompStatus fields (3 of them, complete, void and failed) as well as (All) (also defaulting to ALL)

    I can get it working using the 3 items (Complete, failed, void) and this works fine but when I select (All) nothing is displayed.

    I have a subform below that refreshed upon AfterUpdate of cboStatus but the (All) doesn't show anything? Any help would be much appreciated - Thanks.

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by NeilMansell
    I have tried many links on the web to do this but can't seem to get this working...

    Here's my dilema;

    I have a combobox named cboStatus which is a Table/Query linked to 'comboobjectives' query

    My 'comboobjectives' looks like this;
    SELECT CompStatus, CompStatus FROM TBL_Objectives UNION SELECT "(All)" AS Tom, Null AS M FROM TBL_Objectives;


    I want it to display the CompStatus fields (3 of them, complete, void and failed) as well as (All) (also defaulting to ALL)

    I can get it working using the 3 items (Complete, failed, void) and this works fine but when I select (All) nothing is displayed.

    I have a subform below that refreshed upon AfterUpdate of cboStatus but the (All) doesn't show anything? Any help would be much appreciated - Thanks.
    How do you handle your "All" currently? What is the query you're using to match/filter the result set? Ordinarily, you have to handle the All by using a wildcard ...
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    Mar 2004
    Posts
    287
    sorry i do not fully understand what you mean. the cboStatus combobox is on the main form and I have a subform that is linked via a query that checks the cboStatus box and updates the subform accordingly> Is this what you mean?

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by NeilMansell
    sorry i do not fully understand what you mean. the cboStatus combobox is on the main form and I have a subform that is linked via a query that checks the cboStatus box and updates the subform accordingly> Is this what you mean?
    What I mean is that you have something related to the other 3 options in the combobox. The 4th (All) is a "contrived" option where everything should display ... Question: what is the structure of the subform query?
    Back to Access ... ADO is not the way to go for speed ...

  5. #5
    Join Date
    Mar 2004
    Posts
    287
    the subform query is as follows;

    all fields shown and the following criteria linked;

    Surname = [Forms]![Main].[cboSurname]
    Name = [Forms]![Main].[cboName]
    DOB = [Forms]![Main].[cboDOB]
    CompStatus = [Forms]![Objectives].[cboStatus]
    ObjectSelect = "Objective"

    Hope this helps...

    Did you want me to convert to SQL and display it?
    or is this OK!

  6. #6
    Join Date
    Mar 2004
    Posts
    287
    any further help you can give me please on this problem?

  7. #7
    Join Date
    Jan 2005
    Location
    Nanded, India
    Posts
    397
    NeilMansell,

    I had created asample db to test the "ALL" with combo.

    See the tricks in the attached sample db which I got it from one of the Access Db Site. There are 2 columns in the combo out of which first one is hidden.

    I am sure this would help you.

    WIth kind regards,
    Ashfaque
    Attached Files Attached Files

  8. #8
    Join Date
    Mar 2004
    Posts
    287
    thanks but why do you need two fields and do i link the table to the ref_table (eg: the combo box list table) or the actual data table?

  9. #9
    Join Date
    Jan 2005
    Location
    Nanded, India
    Posts
    397
    Did u go thru the query and table datatype? Second field is text field where as first one is Autonumber. Records are normally read by number which I believe is easy task. But when question come to read all Number (here in clientTypes) we need to defined it with something like "All" that could be captured by making UNION query. Hence code field is placed so that once you select the All Client Type option from combo, it would read "ALL" which is assigned to numeric filed ClientTypes and get the data without criteria.

    Try to implement same trick onto your db Or if wont mind, upload your db with least records or send to me.

    Ashfaque
    Last edited by Ashfaque; 09-04-06 at 07:27.

  10. #10
    Join Date
    Mar 2004
    Posts
    287
    i would like to uload to you (or i can upload to my webspace and give you the link) the file is 7mb though!"!!

    Let me know what you think - thanks.

  11. #11
    Join Date
    Jan 2005
    Location
    Nanded, India
    Posts
    397
    Zip it with less record and concern form/query/report only. And send it me on my email Ashfaque_Online@yahoo.com or on this forum..doesn't matter.

    Regards,
    Ashfaque

  12. #12
    Join Date
    Mar 2004
    Posts
    287
    sweet - have emailed you the database file (zipped 642k) thanks.

    look forward to your comments...

  13. #13
    Join Date
    Jan 2005
    Location
    Nanded, India
    Posts
    397
    Neil, you did not send the table 'Customer' which is the record source of the form AddAllToList.

    Moreover, you should just keep only those concern objects in the db that are to work with. This will help to reduce the heavy size and easy mailing.

    Regards,
    Ashfaque

Posting Permissions

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