display number in another format?

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

Guest

I have a question about format. I have a number, but I need it to be display
like W00001. What I thought now is using string, count how many digits, and
add the W0000 string infront of the number.
In the form, it will display like W00001, W00002, W01321, or W14321

I wonder if there is a better way to do the same thing?

Thank you very much.

fox
 
As the control source for an unbound text box:
="W" & [YourNumberField]
In a query, in query design view in an empty column:
NewField: "W" & [YourNumberField]
 
fox said:
I have a question about format. I have a number, but I need it to be display
like W00001. What I thought now is using string, count how many digits, and
add the W0000 string infront of the number.
In the form, it will display like W00001, W00002, W01321, or W14321

I wonder if there is a better way to do the same thing?


Use a custom format property wherever you are displaying the
number:
\W00000
Note the \ in front of the W
 
I try it, but it display like "W 1". How should modify the format to display
"W00001".

Thank you.

fox
 
I have a question about format. I have a number, but I need it to be display
like W00001. What I thought now is using string, count how many digits, and
add the W0000 string infront of the number.
In the form, it will display like W00001, W00002, W01321, or W14321

I wonder if there is a better way to do the same thing?

Thank you very much.

fox

In an unbound text control:
Either:
="W" & Format([FieldName],"00000")

or..
=Format([FieldName],"\W00000")
 
I tried both, but it will show "#Error" in the textbook in the form. Any idea?

Thank you.

fox

fredg said:
I have a question about format. I have a number, but I need it to be display
like W00001. What I thought now is using string, count how many digits, and
add the W0000 string infront of the number.
In the form, it will display like W00001, W00002, W01321, or W14321

I wonder if there is a better way to do the same thing?

Thank you very much.

fox

In an unbound text control:
Either:
="W" & Format([FieldName],"00000")

or..
=Format([FieldName],"\W00000")
 
If you put the custom format I posted in the format property
of the query field or form text box, then I can not see how
it's possible to get that effect.

You need to explain where your data is coming from, how you
are displaying it and where you placed the custom format.
 
I tried both, but it will show "#Error" in the textbook in the form. Any idea?

Thank you.

fox

fredg said:
I have a question about format. I have a number, but I need it to be display
like W00001. What I thought now is using string, count how many digits, and
add the W0000 string infront of the number.
In the form, it will display like W00001, W00002, W01321, or W14321

I wonder if there is a better way to do the same thing?

Thank you very much.

fox

In an unbound text control:
Either:
="W" & Format([FieldName],"00000")

or..
=Format([FieldName],"\W00000")

It would have been helpful if you had posted the exact expression you
wrote.

You're probably getting #Error because the name of the control is the
same as the name of the field used in the expression.
If you are writing an expression as a control source, always start
with an unbound control.
 
Yes, this is the problem. Thank you very much.

fox

fredg said:
I tried both, but it will show "#Error" in the textbook in the form. Any idea?

Thank you.

fox

fredg said:
On Mon, 5 Jun 2006 05:46:02 -0700, fox wrote:

I have a question about format. I have a number, but I need it to be display
like W00001. What I thought now is using string, count how many digits, and
add the W0000 string infront of the number.
In the form, it will display like W00001, W00002, W01321, or W14321

I wonder if there is a better way to do the same thing?

Thank you very much.

fox

In an unbound text control:
Either:
="W" & Format([FieldName],"00000")

or..
=Format([FieldName],"\W00000")

It would have been helpful if you had posted the exact expression you
wrote.

You're probably getting #Error because the name of the control is the
same as the name of the field used in the expression.
If you are writing an expression as a control source, always start
with an unbound control.
 
Back
Top