Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Sep 2002
    Posts
    294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Combo box auto complete (access 2k)

    I have a combo box which derives its selection from some other combo boxes.

    If the outcome is only 1 choice from the query, is it possible to autocomplete the box. (easily)
    I could probably find some horrendous way to autocomplete it with lots of vba code, but im wondering if there is an easier way.

    The row source for the final combo box is:-

    SELECT qspeclive.[MEDIA TYPE] FROM qspeclive WHERE (((qspeclive.SAMPLE)=Forms!tblsamples2!Sample) And ((qspeclive.[TEST FOR])=Forms!tblsamples2!tbltestr2.Form!testfor) And ((qspeclive.METHOD)=Forms!tblsamples2!tbltestr2.Fo rm!tmethod)) GROUP BY qspeclive.[MEDIA TYPE];

    Where qspeclive is a query.
    tblsamples2 is the main form
    tbltestr2 is the sub form.
    tmethod is the name, and control source of the combo box in question.
    MEDIA TYPE is the final text of what i'm selecting.

    the table that qspeclive is based upon, is laid out so that every choice possible, is represented by a complete row of data.

    Regards,

    Steve

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Combo box auto complete (access 2k)

    Do you already have code to requery the final combo box? If so, you could add something like the following after requerying:
    <code>
    If DCount("*", "qspective", "SAMPLE=Forms!tblsamples2!Sample And " & _
    "[TEST FOR]=Forms!tblsamples2!tbltestr2.Form!testfor And " & _
    "METHOD=Forms!tblsamples2!tbltestr2.Form!tmeth od") = 1 Then
    Me.FinalCombo = Me.FinalCombo.ItemData(0)
    End If
    </code>
    where FinalCombo is the name of ... you get it.

  3. #3
    3 Star Lounger
    Join Date
    Sep 2002
    Posts
    294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo box auto complete (access 2k)

    Thanks hans.. with a bit of tweaking i think this will work.

Posting Permissions

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