Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

About COMBO BOX 's pull down CLICK list

Discussion in 'Information Technology' started by Martin \(Martin Lee\), Jul 28, 2006.

  1. Martin \(Martin Lee\)

    Martin \(Martin Lee\)
    Expand Collapse
    Guest

    I have a combobox, when click, will come out the list (linked to a query's
    field) for example:

    001A0001
    001A0002
    001N00001
    002A0001
    002N00001
    003A0001
    003A0002
    ........(lots of them)

    My question is, the upper list which contains "N" are important to me. When
    click the combobox, I only want to show the numbers which contains the "N".

    How to achieve this?

    Thank you.

    Martin Lee
     
  2. Loading...


  3. Wayne-I-M

    Wayne-I-M
    Expand Collapse
    Guest

    Leave only the N's in the box by removing the unwanted items for the combo
    box with something like

    IIf([ComboSource] Like "*N*" Or "*n*",[ComboSource],"")

    Or

    Use the criteria line in the query with

    Like "*N*" Or "*n*"


    Hope this help

    --
    Wayne




    "Martin (Martin Lee)" wrote:

    >
    > I have a combobox, when click, will come out the list (linked to a query's
    > field) for example:
    >
    > 001A0001
    > 001A0002
    > 001N00001
    > 002A0001
    > 002N00001
    > 003A0001
    > 003A0002
    > ........(lots of them)
    >
    > My question is, the upper list which contains "N" are important to me. When
    > click the combobox, I only want to show the numbers which contains the "N".
    >
    > How to achieve this?
    >
    > Thank you.
    >
    > Martin Lee
    >
    >
    >
    >
     
  4. Martin \(Martin Lee\)

    Martin \(Martin Lee\)
    Expand Collapse
    Guest

    Should I put this sentence in the combo box's CLICK EVENT? HOW?

    The items are from the QUERY, and I cannot remove some of the items directly
    in the QUERY.

    Martin Lee


    "Wayne-I-M" <WayneIM@discussions.microsoft.com> дÈëÏûÏ¢ÐÂÎÅ:E87DFC4C-54D1-40D9-9182-B64727514056@microsoft.com...
    > Leave only the N's in the box by removing the unwanted items for the combo
    > box with something like
    >
    > IIf([ComboSource] Like "*N*" Or "*n*",[ComboSource],"")
    >
    > Or
    >
    > Use the criteria line in the query with
    >
    > Like "*N*" Or "*n*"
    >
    >
    > Hope this help
    >
    > --
    > Wayne
    >
    >
    >
    >
    > "Martin (Martin Lee)" wrote:
    >
    >>
    >> I have a combobox, when click, will come out the list (linked to a
    >> query's
    >> field) for example:
    >>
    >> 001A0001
    >> 001A0002
    >> 001N00001
    >> 002A0001
    >> 002N00001
    >> 003A0001
    >> 003A0002
    >> ........(lots of them)
    >>
    >> My question is, the upper list which contains "N" are important to me.
    >> When
    >> click the combobox, I only want to show the numbers which contains the
    >> "N".
    >>
    >> How to achieve this?
    >>
    >> Thank you.
    >>
    >> Martin Lee
    >>
    >>
    >>
    >>
     
  5. Douglas J Steele

    Douglas J Steele
    Expand Collapse
    Guest

    Wayne: That won't work.

    You can't chain conditions like that: it would have to be

    IIf([ComboSource] Like "*N*" Or [ComboSource] Like "*n*", [ComboSource], "")

    Fortunately, though, that's not necessary, as Access isn't case-sensitive.

    --
    Doug Steele, Microsoft Access MVP
    http://I.Am/DougSteele
    (no e-mails, please!)


    "Wayne-I-M" <WayneIM@discussions.microsoft.com> wrote in message
    news:E87DFC4C-54D1-40D9-9182-B64727514056@microsoft.com...
    > Leave only the N's in the box by removing the unwanted items for the combo
    > box with something like
    >
    > IIf([ComboSource] Like "*N*" Or "*n*",[ComboSource],"")
    >
    > Or
    >
    > Use the criteria line in the query with
    >
    > Like "*N*" Or "*n*"
    >
    >
    > Hope this help
    >
    > --
    > Wayne
    >
    >
    >
    >
    > "Martin (Martin Lee)" wrote:
    >
    > >
    > > I have a combobox, when click, will come out the list (linked to a

    query's
    > > field) for example:
    > >
    > > 001A0001
    > > 001A0002
    > > 001N00001
    > > 002A0001
    > > 002N00001
    > > 003A0001
    > > 003A0002
    > > ........(lots of them)
    > >
    > > My question is, the upper list which contains "N" are important to me.

    When
    > > click the combobox, I only want to show the numbers which contains the

    "N".
    > >
    > > How to achieve this?
    > >
    > > Thank you.
    > >
    > > Martin Lee
    > >
    > >
    > >
    > >
     
  6. Douglas J Steele

    Douglas J Steele
    Expand Collapse
    Guest

    What do you mean that "The items are from the QUERY, and I cannot remove
    some of the items directly in the QUERY"?

    If you don't want to show all items in the combobox, you must change the
    RowSource for the combobox. There's no other option.

    --
    Doug Steele, Microsoft Access MVP
    http://I.Am/DougSteele
    (no e-mails, please!)


    "Martin (Martin Lee)" <lajitong888@21cn.com> wrote in message
    news:%23VIndpwfGHA.4792@TK2MSFTNGP03.phx.gbl...
    > Should I put this sentence in the combo box's CLICK EVENT? HOW?
    >
    > The items are from the QUERY, and I cannot remove some of the items

    directly
    > in the QUERY.
    >
    > Martin Lee
    >
    >
    > "Wayne-I-M" <WayneIM@discussions.microsoft.com>

    дÈëÏûÏ¢ÐÂÎÅ:E87DFC4C-54D1-40D9-9182-B64727514056@microsoft.com...
    > > Leave only the N's in the box by removing the unwanted items for the

    combo
    > > box with something like
    > >
    > > IIf([ComboSource] Like "*N*" Or "*n*",[ComboSource],"")
    > >
    > > Or
    > >
    > > Use the criteria line in the query with
    > >
    > > Like "*N*" Or "*n*"
    > >
    > >
    > > Hope this help
    > >
    > > --
    > > Wayne
    > >
    > >
    > >
    > >
    > > "Martin (Martin Lee)" wrote:
    > >
    > >>
    > >> I have a combobox, when click, will come out the list (linked to a
    > >> query's
    > >> field) for example:
    > >>
    > >> 001A0001
    > >> 001A0002
    > >> 001N00001
    > >> 002A0001
    > >> 002N00001
    > >> 003A0001
    > >> 003A0002
    > >> ........(lots of them)
    > >>
    > >> My question is, the upper list which contains "N" are important to me.
    > >> When
    > >> click the combobox, I only want to show the numbers which contains the
    > >> "N".
    > >>
    > >> How to achieve this?
    > >>
    > >> Thank you.
    > >>
    > >> Martin Lee
    > >>
    > >>
    > >>
    > >>

    >
    >
     
  7. Martin \(Martin Lee\)

    Martin \(Martin Lee\)
    Expand Collapse
    Guest

    Sorry, "The items are from the TABLE",


    "Douglas J Steele" <NOSPAM_djsteele@NOSPAM_canada.com> дÈëÏûÏ¢ÐÂÎÅ:uGo4aJyfGHA.324@TK2MSFTNGP02.phx.gbl...
    > What do you mean that "The items are from the QUERY, and I cannot remove
    > some of the items directly in the QUERY"?
    >
    > If you don't want to show all items in the combobox, you must change the
    > RowSource for the combobox. There's no other option.
    >
    > --
    > Doug Steele, Microsoft Access MVP
    > http://I.Am/DougSteele
    > (no e-mails, please!)
    >
    >
    > "Martin (Martin Lee)" <lajitong888@21cn.com> wrote in message
    > news:%23VIndpwfGHA.4792@TK2MSFTNGP03.phx.gbl...
    >> Should I put this sentence in the combo box's CLICK EVENT? HOW?
    >>
    >> The items are from the QUERY, and I cannot remove some of the items

    > directly
    >> in the QUERY.
    >>
    >> Martin Lee
    >>
    >>
    >> "Wayne-I-M" <WayneIM@discussions.microsoft.com>

    > дÈëÏûÏ¢ÐÂÎÅ:E87DFC4C-54D1-40D9-9182-B64727514056@microsoft.com...
    >> > Leave only the N's in the box by removing the unwanted items for the

    > combo
    >> > box with something like
    >> >
    >> > IIf([ComboSource] Like "*N*" Or "*n*",[ComboSource],"")
    >> >
    >> > Or
    >> >
    >> > Use the criteria line in the query with
    >> >
    >> > Like "*N*" Or "*n*"
    >> >
    >> >
    >> > Hope this help
    >> >
    >> > --
    >> > Wayne
    >> >
    >> >
    >> >
    >> >
    >> > "Martin (Martin Lee)" wrote:
    >> >
    >> >>
    >> >> I have a combobox, when click, will come out the list (linked to a
    >> >> query's
    >> >> field) for example:
    >> >>
    >> >> 001A0001
    >> >> 001A0002
    >> >> 001N00001
    >> >> 002A0001
    >> >> 002N00001
    >> >> 003A0001
    >> >> 003A0002
    >> >> ........(lots of them)
    >> >>
    >> >> My question is, the upper list which contains "N" are important to me.
    >> >> When
    >> >> click the combobox, I only want to show the numbers which contains the
    >> >> "N".
    >> >>
    >> >> How to achieve this?
    >> >>
    >> >> Thank you.
    >> >>
    >> >> Martin Lee
    >> >>
    >> >>
    >> >>
    >> >>

    >>
    >>

    >
    >
     
  8. Martin \(Martin Lee\)

    Martin \(Martin Lee\)
    Expand Collapse
    Guest

    However, "The items are from the QUERY" or "The items are form the TABLE" is
    not big different in this treatment.


    "Douglas J Steele" <NOSPAM_djsteele@NOSPAM_canada.com> дÈëÏûÏ¢ÐÂÎÅ:uGo4aJyfGHA.324@TK2MSFTNGP02.phx.gbl...
    > What do you mean that "The items are from the QUERY, and I cannot remove
    > some of the items directly in the QUERY"?
    >
    > If you don't want to show all items in the combobox, you must change the
    > RowSource for the combobox. There's no other option.
    >
    > --
    > Doug Steele, Microsoft Access MVP
    > http://I.Am/DougSteele
    > (no e-mails, please!)
    >
    >
    > "Martin (Martin Lee)" <lajitong888@21cn.com> wrote in message
    > news:%23VIndpwfGHA.4792@TK2MSFTNGP03.phx.gbl...
    >> Should I put this sentence in the combo box's CLICK EVENT? HOW?
    >>
    >> The items are from the QUERY, and I cannot remove some of the items

    > directly
    >> in the QUERY.
    >>
    >> Martin Lee
    >>
    >>
    >> "Wayne-I-M" <WayneIM@discussions.microsoft.com>

    > дÈëÏûÏ¢ÐÂÎÅ:E87DFC4C-54D1-40D9-9182-B64727514056@microsoft.com...
    >> > Leave only the N's in the box by removing the unwanted items for the

    > combo
    >> > box with something like
    >> >
    >> > IIf([ComboSource] Like "*N*" Or "*n*",[ComboSource],"")
    >> >
    >> > Or
    >> >
    >> > Use the criteria line in the query with
    >> >
    >> > Like "*N*" Or "*n*"
    >> >
    >> >
    >> > Hope this help
    >> >
    >> > --
    >> > Wayne
    >> >
    >> >
    >> >
    >> >
    >> > "Martin (Martin Lee)" wrote:
    >> >
    >> >>
    >> >> I have a combobox, when click, will come out the list (linked to a
    >> >> query's
    >> >> field) for example:
    >> >>
    >> >> 001A0001
    >> >> 001A0002
    >> >> 001N00001
    >> >> 002A0001
    >> >> 002N00001
    >> >> 003A0001
    >> >> 003A0002
    >> >> ........(lots of them)
    >> >>
    >> >> My question is, the upper list which contains "N" are important to me.
    >> >> When
    >> >> click the combobox, I only want to show the numbers which contains the
    >> >> "N".
    >> >>
    >> >> How to achieve this?
    >> >>
    >> >> Thank you.
    >> >>
    >> >> Martin Lee
    >> >>
    >> >>
    >> >>
    >> >>

    >>
    >>

    >
    >
     
  9. Martin \(Martin Lee\)

    Martin \(Martin Lee\)
    Expand Collapse
    Guest

    Is it possible to make some argument in the "Rowsource for the combo box" in
    order to do this?

    My "Rowsource for the combo box" is now: SELECT aaaquery.numbers, FROM
    aaaquery order by aaaquery.number DESC ;


    I mean, is it possible to add something after the "DESC", so that the combo
    box's list will only show the numbers with "N", or, the numbers with "N"
    could arrange to the most front places ( so that the user can chosse them
    easily)


    Thanks.

    Martin Lee



    "Martin (Martin Lee)" <lajitong888@21cn.com> дÈëÏûÏ¢ÐÂÎÅ:e$d8YuvfGHA.4892@TK2MSFTNGP02.phx.gbl...
    >
    > I have a combobox, when click, will come out the list (linked to a query's
    > field) for example:
    >
    > 001A0001
    > 001A0002
    > 001N00001
    > 002A0001
    > 002N00001
    > 003A0001
    > 003A0002
    > .......(lots of them)
    >
    > My question is, the upper list which contains "N" are important to me.
    > When click the combobox, I only want to show the numbers which contains
    > the "N".
    >
    > How to achieve this?
    >
    > Thank you.
    >
    > Martin Lee
    >
    >
    >
     
  10. Martin \(Martin Lee\)

    Martin \(Martin Lee\)
    Expand Collapse
    Guest

    Thank you! Thanks you! With your help, I got it!

    The method is:

    in the Rowsource for the combo box: SELECT aaaquery.numbers, FROM aaaquery
    WHER AAAQUERY.NUMBERS LIKE "*N*" order by aaaquery.number DESC ;

    Without your help, I cannot think out this solution!

    Thank you!

    Martin Lee



    "Martin (Martin Lee)" <lajitong888@21cn.com> дÈëÏûÏ¢ÐÂÎÅ:e$d8YuvfGHA.4892@TK2MSFTNGP02.phx.gbl...
    >
    > I have a combobox, when click, will come out the list (linked to a query's
    > field) for example:
    >
    > 001A0001
    > 001A0002
    > 001N00001
    > 002A0001
    > 002N00001
    > 003A0001
    > 003A0002
    > .......(lots of them)
    >
    > My question is, the upper list which contains "N" are important to me.
    > When click the combobox, I only want to show the numbers which contains
    > the "N".
    >
    > How to achieve this?
    >
    > Thank you.
    >
    > Martin Lee
    >
    >
    >
     
  11. Martin \(Martin Lee\)

    Martin \(Martin Lee\)
    Expand Collapse
    Guest

    Thank you! Thanks you! With your help, I got it!

    The method is:

    in the Rowsource for the combo box: SELECT aaaquery.numbers, FROM aaaquery
    WHER AAAQUERY.NUMBERS LIKE "*N*" order by aaaquery.number DESC ;

    Without your help, I cannot think out this solution!

    Thank you!

    Martin Lee



    "Martin (Martin Lee)" <lajitong888@21cn.com> дÈëÏûÏ¢ÐÂÎÅ:e$d8YuvfGHA.4892@TK2MSFTNGP02.phx.gbl...
    >
    > I have a combobox, when click, will come out the list (linked to a query's
    > field) for example:
    >
    > 001A0001
    > 001A0002
    > 001N00001
    > 002A0001
    > 002N00001
    > 003A0001
    > 003A0002
    > .......(lots of them)
    >
    > My question is, the upper list which contains "N" are important to me.
    > When click the combobox, I only want to show the numbers which contains
    > the "N".
    >
    > How to achieve this?
    >
    > Thank you.
    >
    > Martin Lee
    >
    >
    >
     

Share This Page