hi all!
I need to set precision to the left of decimal. For the number field i have to set the field precision such that the nos should be in a format as 0001,0002,0003------------------.9999.
Thanks

Dani AI

Generated

As suggested, a display format on the field is the usual way to show leading zeros, but reported it didn't appear for single‑digit entries. In Access a numeric format affects presentation only; the underlying value stays numeric. Two common reasons the format looks like it isn't applied are: the form control's Format property overrides the table field, and datasheet/form views sometimes don't refresh the display until the control loses focus or the object is reopened.

Confirm the field's Data Type is Number (not Text) and check whether data is entered via a form or directly in the table. When values come in through a form, the textbox control's Format property takes precedence over the table design. For consistent output (display or export) format at the query or report level; calculated fields also work. Examples that produce a four‑digit, zero‑padded string:

SELECT Format([MyNumberField], "0000") AS FourDigit
FROM MyTable;

SELECT Right("0000" & [MyNumberField], 4) AS FourDigit
FROM MyTable;

Notes and cautions: formatting is display‑only—numeric storage and calculations remain unchanged. If entry must be constrained to four digits, apply an input mask or validation on the form; storing numbers as text to preserve leading zeros is discouraged if arithmetic is needed. Also remember that Format() and Right(...) return text, so any further numeric math must use the original numeric field.

Given that attached a sample DB, the control property sheet in that file is the logical place to inspect. Setting the Format on the form/report control (rather than relying only on the table) and refreshing/reopening the object normally resolves the issue.

Recommended Answers

All 3 Replies

Hi,

In the design view select the field and in the format property (in the lower part of the table design view) put 0000. This will show the number 1 as 0001 or 888 as 0888 noting that it is a matter of just format that means the number will actually stay 1 or 88.

hi friend!
Thank u for u'r reply. I have tried your suggestion. But it is not working. when i enter a single digit no, the format is not changing.plz give me any other idea to do it.
thanks

Hi,
I have attached u a DB with one table to check it, if I wrongly understood you please clarify.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.