How to pack a number to 4 digits?

B

Baby Face Lee

Hi there,
I thought this was simple but what I've done isn't working. I want a
variable to be packed to 4 digits (with preceding zeros). Here's what I've
done:

lngBatchID = Format(lngLastBatchID, "0000")

Can you advise me on how I should have written this piece of code?

Thanks guys!

Lee
 
S

solex

Without seeing all of your code, I would suspect that lngBatchID is of a
Long Datatype. If you convert it to a string datatype it will work fine...
 

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