Results 1 to 2 of 2
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Posts
    1,119
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Combo Box (2003)

    I have a combo box on a form where they select a client number and the client numbers information comes up on the form. I selected two fields for the combo box - the client number (which is first) and then the name. I want them to be able to put a letter in the combo box and bring up those records starting with G for instance but that would mean putting Client name first. The problem is some of the names are not unique so I need the combination of the client number and name to get the right record. I used the wizard to create the combo box. This is the code Access generated:
    Private Sub Combo63_AfterUpdate()
    ' Find the record that matches the control.
    Dim rs As Object

    Set rs = Me.Recordset.Clone
    rs.FindFirst "[Affcl No] = '" & Me![Combo63] & "'"
    If Not rs.EOF Then Me.Bookmark = rs.Bookmark
    End Sub

    How could I use CLname first so they can search and also use "Affcl No" to make sure I get the right record?

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

    Re: Combo Box (2003)

    Set the properties of the combo box as follows:

    In the Format tab of the Properties window:
    Column Count: 2
    Column Widths: 0";1" (or similar)

    In the Data tab of the Properties window:
    Bound Column: 1

    These settings mean that the combo box will display the client name, but the value of the combo box will be the corresponding client number.
    The user can type the first letters of a client's name, the combo box will jump to the first matching name.

Posting Permissions

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