Filling in the gaps

A

anniegetyourgun

Hi,

I’m really stuck with this one. I have a field named Patient ID within this
field are numbers; unfortunately they are varied in length, from 4 digits up
to a maximum of 7 digits long.

My problem is: I need to make all of my Patient IDs 7 digits long, by
preceding them with zeros.

Eg: 4516 needs to read 0004516, 45167 needs to read 0045167 etc. etc.

I have no idea how to do this, any help would be greatly appreciated.

Annie
 
D

Duane Hookom

You can create an expression like:
Right("0000000" & [Patient ID], 7)
Use this to either update the field or just display the new value.
 
M

Marshall Barton

anniegetyourgun said:
I’m really stuck with this one. I have a field named Patient ID within this
field are numbers; unfortunately they are varied in length, from 4 digits up
to a maximum of 7 digits long.

My problem is: I need to make all of my Patient IDs 7 digits long, by
preceding them with zeros.

Eg: 4516 needs to read 0004516, 45167 needs to read 0045167 etc. etc.

I have no idea how to do this, any help would be greatly appreciated.


Don't do that. The numbers are correct as is. All you need
to do is format the numbers when they are displayed in a
form or report text box by setting the text boxes' Format
property to the custom format:
0000000
 
A

anniegetyourgun via AccessMonster.com

Marshall said:
IÂ’m really stuck with this one. I have a field named Patient ID within this
field are numbers; unfortunately they are varied in length, from 4 digits up
[quoted text clipped - 6 lines]
I have no idea how to do this, any help would be greatly appreciated.

Don't do that. The numbers are correct as is. All you need
to do is format the numbers when they are displayed in a
form or report text box by setting the text boxes' Format
property to the custom format:
0000000
Thanks. They both worked, i wish id thought of simply formatting the numeric
field in the first place. Homer Simpson moment.
 

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