How to pack a number to 4 digits?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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...
 
Back
Top