Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2014

    Unanswered: Using Combo box with QBF returning incorrect results

    I need some help. I am using query by form to create a result set. Using only text boxes the the results are correct, however when using a combo box the query returns nothing. If the combo box is a null value then the query returns the correct information. I need to use combo boxes for selecting the criteria. This has me stumped. I am using a form that is not using any query or table for the text/combo boxes. The text/combo boxes are unbound.
    Query design for combo box is as follows
    Field: alljobnumbers
    Table: tblData
    Sort: Ascending
    Show: check
    Criteria [forms]![frmQBFtest]![jobnum] or [forms]![frmQBFtest]![jobnum] is null

    Thanks in advance

  2. #2
    Join Date
    Jun 2005
    Richmond, Virginia USA
    Provided Answers: 19
    My guess would be that the Bound Field of the Combobox is not what you think it is. (I know you said that "The text/combo boxes are unbound," meaning that there is nothing in their Control Source Properties, but all Comboboxes have a 'Bound Field,' as in the above context, meaning the Field that they return when a selection is made. The Access Gnomes have a bad habit, when a Query is used as the RowSource of a Combobox, of adding an Autonumber Field and making it the Bound Field.

    Place this code in the code module of your Form, replacing Combo20 with the actual name of your Combobox:

    Private Sub Combo20_AfterUpdate()
     MsgBox Me.Combo20
    End Sub

    Now run the Form and make a selection from the Combobox; is it returning what you thought it would?

    Linq ;0)>
    Hope this helps!

    The problem with making anything that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Tags for this Thread

Posting Permissions

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