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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Format Number to text in email

Status
Not open for further replies.

niteraven

Technical User
Oct 26, 2006
92
0
0
US
Hello All

I am trying to format an number (long integer) into text to send an automated email from Access. I have the format in the table and am able to get this format to work everywhere but when I try to format the number while sending email.

so the number is 1 (no leading zeros), when formatted on the form it shows as NC-00001. But when sending email you cannot use the same custom format "NC-1"0000

Any help would be greatly appreciated
Thanks
Raven
 
How about:

Code:
Dim i As Integer

i = 1

MsgBox "NC-" & [blue]Format(i, "00000")[/blue]

Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
 
Hi Andy

Thanks - that worked

I just used:
varNcNum = Format(Forms!frmName!Nonum, "0000")
VNCno = "NC-1" & varNcNum

Worked like a champ! Thanks again!

Raven
 
You may make it even simpler by:
[tt]
VNCno = "NC-1" & Format(Forms!frmName!Nonum, "0000")
[/tt]

Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top