var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Formatting a number in a report
="Our reference: DCX" & [case_number] & " Transaction" & Format(Now()," yyyy mmm dd hh:nn")
The above results in the following appearing on the Report:
Our reference: DCX 1 Transa..... etc.
The number after DCX is supposed to come out as 0001.
How do I change the code to format it as such.
It doesnt seem to work:
="Our reference: DCX" & Format([case_number],0) & " Exclusion" & Format(Now()," yyyy mmm dd hh:nn")
It changes the 0000 into a 0
-----DCX" & Format([case_number],0) -----
Any suggestions. I'm I putting it in the right context?
If the number is stored as text this should not be a problem.
If the number is stored as a number there are 2 things:
1. Format the textbox you are outputting it to by setting the "format" control to 0000 (or however many digits you want).
2. change it to a string in code:
I think the format function converts the data to a string for display purpouses... But dont quote me on that .
dim n as string
n = format([case_number], "0000")
me.yourtextbox = "Our reference: DCX" & n & " Exclusion" & Format(Now()," yyyy mmm dd hh:nn")
The part of your expression that says Format([case_number],0) needs to be Format([case_number],"0000") . Don't forget the quotation marks around the zeroes.