• Combo Box Expansion (Access2000 SR1)

    Author
    Topic
    #362047

    Two things:
    1. I would like to have a combo box expand as soon as it gets the focus
    without the user clicking the arrow. Anyone know how I can do this?
    2. When using a combo box to look up a customer ID via a phone number field with an input mask (on the form), the auto expand does not work properly. It fills in the entire field when the first character is entered and the cursor moves all the way to the right. How can I get around this? Taking out the input mask works but then the phone number displays without a hyphen.

    Viewing 0 reply threads
    Author
    Replies
    • #548981

      1. Put something like Combo1.DropDown in the GotFocus event procedure for the Combo1.

      2. I don’t understand. Are you using the input mask on a textbox or a combobox? Comboboxes are supposed to fill in with the first match they find, which is why using an input mask on them is such a frustrating thing to try. The simplest way to handle it would probably be to take off the input mask and create a two column in combobox that contains formatted phone numbers and a hidden CustomerID associated with the actual phone number. That way, the user would be entering format and all and finding matches based on the formatted value, but the customerID would simply be the value in the hidden column. No lookup would be required.

      • #548986

        1. Thanks. That works.
        2. I tried to use an input mask in the properties of a combo box, set to look up customerID values (column1) when the user enters a phone number (column2). The phone numbers are otherwise being displayed without the hyphen despite trying to set the format property in the form or the table. They do display fine in the table where an input mask is set. So the I guess the question is how do I format the phone numbers so they will appear correctly. Otherwise my combo is set up the way you describe.

        • #548988

          I have attached an example Acc2K database. It contains 1 table (tblCustomers), which contains two fields (CustomerID and PhoneNumber).

          It also contains a form with a combo box and a text box.

          The combobox looks up the tblCustomer table and returns all CustomerID’s and their Associated phone numbers formatted to include a hyphen between the 3rd and 4th digits. The CustomerID column is hidden (the column width property of the combo box is set to 0 for the first column).

          The OnChange event takes the CustomerID value select in the combo box (even though the user can’t see it) and places it in the textbox txtCustomerID.

          The phone number is formatted in the row source of the combobox (look at the properties of the combobox and click the data tab, then click the elipsis (…) next to the Row Source property to bring up the query builder).

          Hope this helps

          J

          • #549016

            I don’t usually have a problem downloading from this site but this attachment is locking me out. Doesn’t even ask for my password.

            • #549017

              I’ve also tried to download and am getting an Access Forbidden error.

              I’ll try it again:

            • #549018

              I’ve just tried downloading the above attachment and it seems to work for me, how about give this one a try then smile

            • #549051

              Downloaded fine this time. To work we go.

            • #549199

              I see … (“said the blind man”). Thanks Jayden!

            • #549207

              Glad to help smile

    Viewing 0 reply threads
    Reply To: Combo Box Expansion (Access2000 SR1)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: