HELP!! 0's at the front of numbers....

quasimodo

Registered User.
Local time
Today, 23:47
Joined
Mar 5, 2003
Messages
33
I'm currently doing a project on a hotel booking system. I am using Microsoft Access to implement my system on. :confused:

I'm having trouble with the room number field. Its got to be a 2 digit number.
If I put the input mask as "00", Access takes away the beginning zero when I try and enter data... eg if I enter 01, it comes out as just 1.
I have tried putting the input mask as "\00", but this doesnt let me input a value such as 12, as the 0 at the front is then unchangable.

Is there any way of doing it so I can get the first 0 to appear, but also so I can have the 2 digit number as higher than 9 (i.e. 10 onwards).

Can anyone help me with this...?
 
Since your room numbers can't be calculated upon why not just make the room number a text field with the 00 Input mask?
 
I had this same problem, and the solution i found was to append the number prefixes using a query. Let the table generate the numbers via autonumber or user imput, and then create a query.
You then use an expression that looks up the length of the value in the field, and if it is of length=1 add a '0' in front of it.

I think this wil probably work for you:

Expression: IIf(Len([ROOM NUMBER])=1,"0" & [ROOM NUMBER],[ROOM NUMBER])

Good Luck!
 
thanks.... i was looking for a way of getting that for autonumber
 
Does it really have to be a two digit number or does it just have to be formatted that way. Just set the format of the number field to 00 then it will always appear that way.
 
well the room numbers need to be formatted that way, and i had them as number data type (really dumb i know), thats why i couldnt get the 0 to appear at the front.
 

Users who are viewing this thread

Back
Top Bottom