Control source in text box

B

bobojones

I am using the following expression in a control source =[ClientDesignator]
& "-" & [CatDesignator] & "-" & [FunctionDesignator] & "-" & [Version]

When I run the report the data is correct but I would like the version to
show up as 0001 instead of 1. Is there a way to do this?

Thanks
 
C

Carl Rapson

bobojones said:
I am using the following expression in a control source =[ClientDesignator]
& "-" & [CatDesignator] & "-" & [FunctionDesignator] & "-" & [Version]

When I run the report the data is correct but I would like the version to
show up as 0001 instead of 1. Is there a way to do this?

Thanks

Use the Format method:

.... & Format([Version],"0000")

Carl Rapson
 
M

Mikal via AccessMonster.com

Try it like this (No guarantees, of course). This assumes that the [Version]
is numeric text and not an actual number. Actually, I just tried it both as
text and as an integer and it worked without explicitly converting the int to
text, so it ought to be fine.

=[ClientDesignator] & "-" & [CatDesignator] & "-" & [FunctionDesignator] & "-
" & FORMAT([Version],"0000")

Watch out for word-wrap
Mike

bobojones wrote:
=[ClientDesignator] & "-" & [CatDesignator] & "-" & [FunctionDesignator] & "-
" & [Version]
 
B

bobojones

Thanks, This works great
Carl Rapson said:
bobojones said:
I am using the following expression in a control source
=[ClientDesignator] & "-" & [CatDesignator] & "-" & [FunctionDesignator] &
"-" & [Version]

When I run the report the data is correct but I would like the version to
show up as 0001 instead of 1. Is there a way to do this?

Thanks

Use the Format method:

... & Format([Version],"0000")

Carl Rapson
 

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