Results 1 to 10 of 10

Thread: to show 'All'

  1. #1
    Join Date
    Jul 2007
    Location
    Columbia SC
    Posts
    81

    Unanswered: to show 'All'

    Hey,
    I have a combo box which is populating with correct data. In query i have selected two columns to show 'All' and '*'.

    SELECT DISTINCT Primary_System, Primary_System
    FROM Master_Table
    UNION ALL
    SELECT '(All)', '*'
    ORDER BY Primary_System


    and in combo box i m having '*'. I tried many values of columnWidth property.

    Now what value of columnwidths property of combo box i need to set in order to have the 'All' instead of '*'.
    Where listWidth=1.5''.
    ColumnBound = 1
    ColumnCount = 2

    Thx in advance

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Is this an Access question? Or something else?
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    the front end is Access, the back end is SQL Server

    see this thread

    however, comboboxen are part of the front end, so let's move this thread to the Access forum
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  4. #4
    Join Date
    Jul 2007
    Location
    Columbia SC
    Posts
    81
    any solution.....
    The frontend is access...

  5. #5
    Join Date
    Jul 2007
    Location
    Columbia SC
    Posts
    81
    I already have 'All' Option in my combo box..
    but when application start the default text 'all' is not coming. which i want....SO there is something to do with ColumnWidths property value. and i m unsure abt the value...

  6. #6
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    if you want 'all' to show in your combobox, in the forms onOpen event set the combobox to "All" (ie. me!MyComboboxName = "All") or set the default value of the combobox "All". Make sure though that you're bound column is a text field verses an integer field. It should not have anything to do with the columnwidth unless you're manipulating that property.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  7. #7
    Join Date
    Jul 2007
    Location
    Columbia SC
    Posts
    81
    Thx but
    Yes i m manipulating this property with the value of '*' instead of 'all'. What the only thing i need that wanna leave '*' as default value but wanna show 'All' in combo box.
    Last edited by musman; 07-19-07 at 11:38.

  8. #8
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Can you do a test in the AfterUpdate of this combobox so if it ="All", then it ="*" before you execute your next query or code? Is this combobox based on a rowsource "Query" or Valuelist?
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  9. #9
    Join Date
    Jul 2007
    Location
    Columbia SC
    Posts
    81
    Its based on Query.How can i use AfterUpdate. Whn i need 'All' as a default text in the combo box when application starts.. I mean in the form's load event ...and '*' as its default value of the combo box....

  10. #10
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Others might differ but I might have an invisible unbound text box on the form and when the user selects a value in the combobox, have it test to see if "All" (or a null value) is selected (in the AfterUpdate of the combobox) and put "*" in the unbound text box otherwise put the value of the combobox in the unbound text box. Then base your code (or whatever else you're running against the combobox) with criteria = to the unbound invisible text box instead of the combobox.

    You can then easily set the unbound text box default value = "*" and you shouldn't have any problems setting the combobox to "All" as a default value.

    ie...
    Private Sub MyComboboxName_AfterUpdate()
    if me!MyComboboxName = "All" then me!CriteriaFieldName = "*" else me!CriteriaFieldName = me!MyComboboxName
    End Sub
    Last edited by pkstormy; 07-19-07 at 13:09.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

Posting Permissions

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