Results 1 to 3 of 3

Thread: Counting data inside Dbcombo box?

  1. #1

    Thread Starter
    Addicted Member CoMMiE's Avatar
    Join Date
    Jul 2000
    Location
    Malaysia, Kuala Lumpur
    Posts
    179

    Thumbs up

    Hi
    How can i count the number of data that is inside a Dbcombo box?

    Thanks in advance

  2. #2
    Frenzied Member Buzby's Avatar
    Join Date
    Jan 1999
    Location
    UK
    Posts
    1,670
    Assuming you filled the combobox with something like;

    MyRS.Open "SELECT name FROM tbl_Names",MyConn

    You can use

    MyRs.Open "SELECT COUNT(name) AS Total FROM tbl_Names",MyConn
    Total=MyRs("Total")

    to get the total number if items in the box.
    'Buzby'
    Visual Basic Developer
    "I'm moving to Theory. Everything works there."

  3. #3
    New Member
    Join Date
    Oct 2000
    Posts
    9

    Re: No of items in dbcombo

    Well, what about
    Total = MyDBCombo.visiblecount
    that should work too!

Posting Permissions

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



Click Here to Expand Forum to Full Width