Results 1 to 12 of 12

Thread: Combo Box

  1. #1
    Join Date
    Mar 2004
    Location
    Bournemouth, England
    Posts
    29

    Unanswered: Combo Box

    I have a combo box and I wish to count entries with a specific record source value. I want to count all entries in the combo box where PAID has a value of "NO".

    Attached a pic to clarify the problem.
    Attached Thumbnails Attached Thumbnails pic.jpg  

  2. #2
    Join Date
    Nov 2002
    Location
    Belgium
    Posts
    243

    Re: Combo Box

    Originally posted by cwlord
    I have a combo box and I wish to count entries with a specific record source value. I want to count all entries in the combo box where PAID has a value of "NO".

    Attached a pic to clarify the problem.
    Try this:

    Code:
    "SELECT COUNT(*) FROM" & myCombobox.RowSource & "WHERE PAID = No"

  3. #3
    Join Date
    Mar 2004
    Location
    Bournemouth, England
    Posts
    29
    WHERE DO I NEED TO PUT THIS FOR IT TO BE DISPLAY IN A TEXT BOX IN THE SUBFORM.

  4. #4
    Join Date
    Nov 2002
    Location
    Belgium
    Posts
    243
    Originally posted by cwlord
    WHERE DO I NEED TO PUT THIS FOR IT TO BE DISPLAY IN A TEXT BOX IN THE SUBFORM.
    In the event of an object (eg a button)

    Code:
    dim rs as new ADODB.recordset
    dim strSQL as string
    dim numberOfNoPaidRecords as integer
    
    strSQL = "Select count(*) ..................."
    
    rs.open strSQL, CurrentProject.Connection, adOpenStatic, adLockReadOnly
    
    numberOfNoPaidRecords = rs.fields(0)
    
    rs.close
    
    myTextbox.value = numberOfNoPaidRecords

  5. #5
    Join Date
    Mar 2004
    Location
    Bournemouth, England
    Posts
    29
    GET THE FOLLOWING ERROR ANY IDEAS?
    Attached Thumbnails Attached Thumbnails pic1.jpg  

  6. #6
    Join Date
    Mar 2004
    Location
    Bournemouth, England
    Posts
    29
    Dim rs As New ADODB.Recordset

    DO I NEED

    Dim rs As New ADODB.Recordset AS WHAT

  7. #7
    Join Date
    Nov 2002
    Location
    Belgium
    Posts
    243
    Originally posted by cwlord
    Dim rs As New ADODB.Recordset

    DO I NEED

    Dim rs As New ADODB.Recordset AS WHAT
    The recordset will store all the result which are given you by the selectstatement, so you can browse through them.
    In this case there will only be one record with one field.

    Do you have a reference to Microsoft ActiveX Data Objects Library?

  8. #8
    Join Date
    Mar 2004
    Location
    Bournemouth, England
    Posts
    29
    NOT SURE WHAT YOU MEAN?

  9. #9
    Join Date
    Nov 2002
    Location
    Belgium
    Posts
    243
    Originally posted by cwlord
    NOT SURE WHAT YOU MEAN?
    about what?

    The use of a recordset or the reference?

  10. #10
    Join Date
    Mar 2004
    Location
    Bournemouth, England
    Posts
    29
    ABOUT THE REFERENCE. HOW TO I MAKE IT WORK.

  11. #11
    Join Date
    Nov 2002
    Location
    Belgium
    Posts
    243
    Originally posted by cwlord
    ABOUT THE REFERENCE. HOW TO I MAKE IT WORK.
    Suppose you are writing software in VB and you need a mail to be sent automatically when a button is pressed.
    This is not possible without a reference to the outlook-library.

    You have to make the reference.
    Then you declare a variable as an outlook-object and from then on you can use a lot of new functions for sending mails and other things you normally do with outlook.


    To put the reference in your case --> open Microsoft Visual Basic --> go to Tools / References.
    A list with possible references will appear.
    Search for the Microsoft ActiveX Data Objects Library and check it.
    That's all.

  12. #12
    Join Date
    Mar 2004
    Location
    Bournemouth, England
    Posts
    29
    OK ILL GIVE IT A GO

Posting Permissions

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