Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Telephone Mask - combo box population problem

Status
Not open for further replies.

mas5

Programmer
Dec 15, 2002
98
US
I have a combo box with a list of telephone numbers. I am using the telephone mask as my input mask. I have AutoExpand set to yes. As soon as I enter the first number the rest of the field is filled in and my cursor is set to the end of the field. (So, for example, when I enter a 7 the first telephone number beginning with a 7 is always selected.) I can't enter any more numbers without back spacing and then the autoepxand doesn't function anymore.

When I remove the input mask then the autoexpand works as usual - I can continue to enter the second, third, etc. number and the search gets narrowed.

I'd like to be able to use the input mask as it makes this easier for the user, but it just doesn't seem to work correctly.

Has anyone run into this problem before? Is there as solution to it?

Thanks.
 
In the properties for the control try changing the TEXT ALIGN from GENERAL TO LEFT. Later.
 
Why does it make it easier for the users to have the mask on the combination box? Is the list of phone numbers formatted or not? You can always format the values BeforeUpdate or AfterUpdate with,

Sub MyControl_BeforeUpdate(Cancel As Integer)

Format(MyControl, "(@@@) @@@-@@@")

End Sub

The mask is normally used for a text box. I realize if you are allowing the user to enter new values that it may be useful but personally, I believe all the mask display stuff clutters the display and also causes some misentries if the user doesn't enter it properly.

With this solution you can also perform some data verification to check that it is numeric, and has the proper number of characters prior to allowing the user to update the values. If it isn't valid simply set Cancel to true, give them a message about what is wrong, and keep the cursor in the control.





-------------------------------------
scking@arinc.com
Try to resolve problems independently
Then seek help among peers or experts
But TEST recommended solutions
-------------------------------------
 
Thanks for your help, but neither suggestion worked. Align left didn't change the behavior.

Scking - yes, I am allowing the users to enter new values. My field is a ten digit integer and I'm not saving the mask in the field. When speaking with my users they did note that it would be easier if the could see the telephone mask. It makes it easier to see if you have entered the number properly if it is in the format that you are used to looking it at instead of a 10 digit number. The Format(MyControl... didn't seem to work either and then I lost the formatted display for telephone numbers that are displayed.

Anybody have any other suggestions?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top