Results 1 to 14 of 14
  1. #1
    Join Date
    Nov 2003
    Posts
    32

    Unanswered: adding items to a combobox at run time

    Hi all,

    I need to add items to the combo box during the run time. i did not find 'additem' method in access 2000. 'additem' method is there in Access XP.

    please help me.

    Thanks in advance.

  2. #2
    Join Date
    Nov 2003
    Posts
    1,487
    What is it you are adding to the ComboBox. Is it data from a table? Is the ComboBox to contain item for a Value List?

  3. #3
    Join Date
    Nov 2003
    Posts
    32
    i need to add some data from the table.

  4. #4
    Join Date
    Jan 2004
    Location
    Myanmar (Burma)
    Posts
    42

    Arrow Re: adding items to a combobox at run time

    The code to intinalise the combo box is like this.

    Private Sub Form_Load()
    Dim strData As String

    For I = ... To ...
    ......

    Combo0.AddItem strData

    Next I

    End Sub

  5. #5
    Join Date
    Nov 2003
    Posts
    32
    Thanks for you code. But i didn't find additem method in access 2000

  6. #6
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Originally posted by annam
    Thanks for you code. But i didn't find additem method in access 2000
    You have to adjust it RowSource like that:

    yourComboBox.RowSource ="yourTableName2GetDataFrom"

  7. #7
    Join Date
    Jan 2004
    Location
    Myanmar (Burma)
    Posts
    42

    I supposed that additem method can applied since Access 97.

    Originally posted by annam
    Thanks for you code. But i didn't find additem method in access 2000
    Pls check the attached file.

  8. #8
    Join Date
    Jan 2004
    Location
    Myanmar (Burma)
    Posts
    42

    Here's the attachment

    Originally posted by annam
    Thanks for you code. But i didn't find additem method in access 2000
    i forgot to zip it.
    now i ziped and attached
    Attached Files Attached Files

  9. #9
    Join Date
    Aug 2003
    Posts
    47

    here's your solution.

    Heya.

    Access 2000 doesn't have an 'AddItem' method for combo/list boxes. Instead it has 'RowSource' method which you can use to add items to your combo/list box during run.

    I've attached the .zip file that demostrates that. It's your db that works.
    Attached Files Attached Files
    F..ck it, gimme a beer... Jimi Hendrix RULES!

  10. #10
    Join Date
    Jan 2004
    Location
    Myanmar (Burma)
    Posts
    42

    Unhappy Re: here's your solution.

    Originally posted by sup
    Heya.

    Access 2000 doesn't have an 'AddItem' method for combo/list boxes. Instead it has 'RowSource' method which you can use to add items to your combo/list box during run.

    I've attached the .zip file that demostrates that. It's your db that works.
    Oops

    Sorry guy.

  11. #11
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    In the properties window, did you try to adjust the RowSource property to have a table or a Query or Select statement?

  12. #12
    Join Date
    Nov 2003
    Posts
    32
    I have two field in a table : first name and last name, I want to combine those fields and populate the combo box with the full name. This is my problem

    How can I do that?

    Please help me.

    I didn't find 'additem' method in Access 2000.

    Thanks all

    Bye Bye
    Krishna

  13. #13
    Join Date
    Nov 2003
    Posts
    32
    I also want to add 'NONE' to the Combo box which is not in the table, so that users may select one name or none from the combo box.

    I hope you all understand my problem.

    Thanks all

  14. #14
    Join Date
    Aug 2003
    Posts
    47
    See the attached db for details.
    Attached Files Attached Files
    F..ck it, gimme a beer... Jimi Hendrix RULES!

Posting Permissions

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