Is there a phone mask for a combobox (1 Viewer)

jpl458

Well-known member
Local time
Yesterday, 16:47
Joined
Mar 30, 2012
Messages
1,038
I have a combobox the has a dropdown list of phone numbers. But they display as 5552221313. I want it to display (333)444-5555 but there seems to be no Field Property for combobox to display formatted phone numbers. The closest thing I could fine is this: Forms!Customers!Telephone.InputMask = "(###) ###-####". The information in the box is static.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 16:47
Joined
Oct 29, 2018
Messages
21,510
Are you saying you're allowing your users to enter phone numbers not already in the list of the combo?
 

jpl458

Well-known member
Local time
Yesterday, 16:47
Joined
Mar 30, 2012
Messages
1,038
Are you saying you're allowing your users to enter phone numbers not already in the list of the combo?
No. I just want the phones to display as though they were formatted, in the Combobox. In the list now, they look like 5551212121. In the table they are masked and look like (555)-121-2121. Want to have the combobox display the phone numbers like they are in the table.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 16:47
Joined
Oct 29, 2018
Messages
21,510
No. I just want the phones to display as though they were formatted, in the Combobox. In the list now, they look like 5551212121. In the table they are masked and look like (555)-121-2121. Want to have the combobox display the phone numbers like they are in the table.
Hi. Thanks for the clarification. You don't want Input Mask then. Have you tried the Format property?

If that doesn't work, can you please post the Row Source SQL for your combobox?
 

jpl458

Well-known member
Local time
Yesterday, 16:47
Joined
Mar 30, 2012
Messages
1,038
Hi. Thanks for the clarification. You don't want Input Mask then. Have you tried the Format property?

If that doesn't work, can you please post the Row Source SQL for your combobox?
Didn't even look at format. DOH! When I light up the box and hit format, the dropdown is empty. I am assuming then, that I have to roll my own mask in the format box. Is that correct? If so, I can't find anything that describes how to do that. The row source for the box is

Code:
SELECT tblPhone.[txtPhoneNumber] FROM tblPhone;

The field in the table has a phone mask, and is text.

Thanks
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 16:47
Joined
Oct 29, 2018
Messages
21,510
Didn't even look at format. DOH! When I light up the box and hit format, the dropdown is empty. I am assuming then, that I have to roll my own mask in the format box. Is that correct? If so, I can't find anything that describes how to do that. The row source for the box is

Code:
SELECT tblPhone.[txtPhoneNumber] FROM tblPhone;

The field in the table has a phone mask, and is text.

Thanks
You should be able to use the same markers I'm using here with the Format() function in the Format property, but the following is not tested, so please give it a try first.
Code:
SELECT Format(tblPhone.[txtPhoneNumber], "(000)-000-0000") FROM tblPhone;
 

jpl458

Well-known member
Local time
Yesterday, 16:47
Joined
Mar 30, 2012
Messages
1,038
You should be able to use the same markers I'm using here with the Format() function in the Format property, but the following is not tested, so please give it a try first.
Code:
SELECT Format(tblPhone.[txtPhoneNumber], "(000)-000-0000") FROM tblPhone;
Had to change the 0s to #s then it worked perfectly.

Thank you ,sir.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 16:47
Joined
Oct 29, 2018
Messages
21,510
Had to change the 0s to #s then it worked perfectly.

Thank you ,sir.
Glad to hear you got it sorted out. Good luck with your project.
 

Users who are viewing this thread

Top Bottom