DLookUp Lable and format

G

Guest

I have a DLookUp that I use to put the Address and phone number on all the
user forms and reports. THis way the user only need to input his ot her info
one time and it goes to all the forms and reports. I only have one issue the
phone number just looks like a number. Here is the code.

=DLookUp("L_A1","Labels") So looks like 1234567890

Would like to to look like this Phone (123) 456-7890

Can I do this?
 
A

Andi Mayer

I have a DLookUp that I use to put the Address and phone number on all the
user forms and reports. THis way the user only need to input his ot her info
one time and it goes to all the forms and reports. I only have one issue the
phone number just looks like a number. Here is the code.

=DLookUp("L_A1","Labels") So looks like 1234567890

Would like to to look like this Phone (123) 456-7890

Can I do this?

look for the Format() function in the help file
best is userdefinded format for strings or numeric values

depends what you want
 
G

Guest

Andi,

The help does not tell me how to put it in the DLookUp code. The Tabel
format is set to a phone number format.
 
T

Todd Shillam

You need to change the DLookup code and include formatting at the same time. Here's a rough example--go Google around to get the exact syntax:

Dim yourVariable

yourVariable = Format(DLookUp("L_A1","Labels"), "(###) ###-####")

Again, I'm not sure the format is exactly correct; however, I'm sure this is pretty close.

Best regards,

Todd

Andi,

The help does not tell me how to put it in the DLookUp code. The Tabel
format is set to a phone number format.
 
F

fredg

I have a DLookUp that I use to put the Address and phone number on all the
user forms and reports. THis way the user only need to input his ot her info
one time and it goes to all the forms and reports. I only have one issue the
phone number just looks like a number. Here is the code.

=DLookUp("L_A1","Labels") So looks like 1234567890

Would like to to look like this Phone (123) 456-7890

Can I do this?
Does your DLookUp return the correct Phone Number for the person
selected?

=Format(DLookUp("[L_A1]","Labels"),"(@@@) @@@-@@@@")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top