If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#11
|
|||
|
|||
Formatting phone numbers for list boxes
That took care of it.
Thanks again. "Brian Bastl" wrote: Forgot to mention that if your Listbox is bound, then you'll need to change its control source to reflect the Alias name. Brian "Brian Bastl" wrote in message ... Ron, your sql was fine other than format([Phone],"@@@) As Phone. It's the 'As Phone' part that seems to be causing your circular reference. Just change the last part to 'As CustPhone'. Brian "Ron Weaver" wrote in message ... Brian, I have tried making changes. I just don't know what I'm doing. Here is the SQL before the formatting. If you can look at this and give me some recommendations I sure would appreciate it. SELECT Orders.StartDate, Orders.OrderID, [FirstName] & " " & [LastName] AS Expr1, Customer.Phone FROM Customer INNER JOIN Orders ON Customer.CustomerID = Orders.CustomerID WHERE (((Orders.StartDate) Between [Forms]![OrderDateForm]![txtStartDate] And [Forms]![OrderDateForm]![txtEndDate])) ORDER BY Orders.StartDate; Thanks "Brian Bastl" wrote: Ron, The circular reference is caused by you aliasing the phone field with the same name. Change the alias to something else. HTH, Brian "Ron Weaver" wrote in message ... Hi Doug Thanks for your response. I had tried previously, and I get this message: Circular reference caused by alias 'phone' in query definitions Select list. Please look at my SQL and see if this helps: SELECT Orders.StartDate, Orders.OrderID, [FirstName] & " " & [LastName] AS Expr1, Format([Phone],"(@@@)@@@-@@@@") AS Phone FROM Customer INNER JOIN Orders ON Customer.CustomerID = Orders.CustomerID WHERE (((Orders.StartDate) Between [Forms]![OrderDateForm]![txtStartDate] And [Forms]![OrderDateForm]![txtEndDate])) ORDER BY Orders.StartDate; Thanks "Douglas J. Steele" wrote: Sounds as though you're using an InputMask. When you do, that just affects how the data appears, not how it's stored in the table. In the query, use the Format function (not the Format property) on the phone number field: Format([PhoneNumber], "(@@@)@@@-@@@@") -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "Ron Weaver" wrote in message ... I'm beginning to believe you can't do it. My list box is tied to a query. The phone number is formated for (@@@)@@@-@@@@, but the numbers output are 423888999. In the query datasheet view the formatting is showing correctly. Probably something really simple or impossible. |
#12
|
|||
|
|||
Formatting phone numbers for list boxes
Thanks for the update.
Brian "Ron Weaver" wrote in message ... That took care of it. Thanks again. "Brian Bastl" wrote: Forgot to mention that if your Listbox is bound, then you'll need to change its control source to reflect the Alias name. Brian "Brian Bastl" wrote in message ... Ron, your sql was fine other than format([Phone],"@@@) As Phone. It's the 'As Phone' part that seems to be causing your circular reference. Just change the last part to 'As CustPhone'. Brian "Ron Weaver" wrote in message ... Brian, I have tried making changes. I just don't know what I'm doing. Here is the SQL before the formatting. If you can look at this and give me some recommendations I sure would appreciate it. SELECT Orders.StartDate, Orders.OrderID, [FirstName] & " " & [LastName] AS Expr1, Customer.Phone FROM Customer INNER JOIN Orders ON Customer.CustomerID = Orders.CustomerID WHERE (((Orders.StartDate) Between [Forms]![OrderDateForm]![txtStartDate] And [Forms]![OrderDateForm]![txtEndDate])) ORDER BY Orders.StartDate; Thanks "Brian Bastl" wrote: Ron, The circular reference is caused by you aliasing the phone field with the same name. Change the alias to something else. HTH, Brian "Ron Weaver" wrote in message ... Hi Doug Thanks for your response. I had tried previously, and I get this message: Circular reference caused by alias 'phone' in query definitions Select list. Please look at my SQL and see if this helps: SELECT Orders.StartDate, Orders.OrderID, [FirstName] & " " & [LastName] AS Expr1, Format([Phone],"(@@@)@@@-@@@@") AS Phone FROM Customer INNER JOIN Orders ON Customer.CustomerID = Orders.CustomerID WHERE (((Orders.StartDate) Between [Forms]![OrderDateForm]![txtStartDate] And [Forms]![OrderDateForm]![txtEndDate])) ORDER BY Orders.StartDate; Thanks "Douglas J. Steele" wrote: Sounds as though you're using an InputMask. When you do, that just affects how the data appears, not how it's stored in the table. In the query, use the Format function (not the Format property) on the phone number field: Format([PhoneNumber], "(@@@)@@@-@@@@") -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "Ron Weaver" wrote in message ... I'm beginning to believe you can't do it. My list box is tied to a query. The phone number is formated for (@@@)@@@-@@@@, but the numbers output are 423888999. In the query datasheet view the formatting is showing correctly. Probably something really simple or impossible. |
#13
|
|||
|
|||
Formatting phone numbers for list boxes
John
Brian enlightened me in that I had to change my source code on the list box to show the alias. All is well now. Thanks so much for your help. "John Spencer" wrote: SELECT Orders.StartDate, Orders.OrderID , [FirstName] & " " & [LastName] AS Expr1, Format(Customer.Phone,"(@@@) @@@-@@@@") as Telephone FROM Customer INNER JOIN Orders ON Customer.CustomerID = Orders.CustomerID WHERE (((Orders.StartDate) Between [Forms]![OrderDateForm]![txtStartDate] And [Forms]![OrderDateForm]![txtEndDate])) ORDER BY Orders.StartDate; "Ron Weaver" wrote in message ... Brian, I have tried making changes. I just don't know what I'm doing. Here is the SQL before the formatting. If you can look at this and give me some recommendations I sure would appreciate it. SELECT Orders.StartDate, Orders.OrderID, [FirstName] & " " & [LastName] AS Expr1, Customer.Phone FROM Customer INNER JOIN Orders ON Customer.CustomerID = Orders.CustomerID WHERE (((Orders.StartDate) Between [Forms]![OrderDateForm]![txtStartDate] And [Forms]![OrderDateForm]![txtEndDate])) ORDER BY Orders.StartDate; Thanks "Brian Bastl" wrote: Ron, The circular reference is caused by you aliasing the phone field with the same name. Change the alias to something else. HTH, Brian "Ron Weaver" wrote in message ... Hi Doug Thanks for your response. I had tried previously, and I get this message: Circular reference caused by alias 'phone' in query definitions Select list. Please look at my SQL and see if this helps: SELECT Orders.StartDate, Orders.OrderID, [FirstName] & " " & [LastName] AS Expr1, Format([Phone],"(@@@)@@@-@@@@") AS Phone FROM Customer INNER JOIN Orders ON Customer.CustomerID = Orders.CustomerID WHERE (((Orders.StartDate) Between [Forms]![OrderDateForm]![txtStartDate] And [Forms]![OrderDateForm]![txtEndDate])) ORDER BY Orders.StartDate; Thanks "Douglas J. Steele" wrote: Sounds as though you're using an InputMask. When you do, that just affects how the data appears, not how it's stored in the table. In the query, use the Format function (not the Format property) on the phone number field: Format([PhoneNumber], "(@@@)@@@-@@@@") -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "Ron Weaver" wrote in message ... I'm beginning to believe you can't do it. My list box is tied to a query. The phone number is formated for (@@@)@@@-@@@@, but the numbers output are 423888999. In the query datasheet view the formatting is showing correctly. Probably something really simple or impossible. |
|
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to insert a repeating dash in phone numbers without dashes in. | LemonLiptonTea | New Users | 3 | February 5th, 2005 05:18 PM |
I Need a Formula to Auto-fill Phone Numbers in a Range | twd3lr | Worksheet Functions | 4 | February 4th, 2005 08:38 PM |
Can I upload ONLY names and phone numbers to Blackberry phone W/O. | George Leak | Contacts | 0 | February 3rd, 2005 03:11 AM |
Name database with up to six phone numbers per person | Dan | Database Design | 3 | January 28th, 2005 09:27 PM |
formatting phone numbers | Mindy | Worksheet Functions | 17 | February 17th, 2004 11:00 AM |