Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Number data type blank entry 2

Status
Not open for further replies.

evergrean100

Technical User
Dec 1, 2006
115
US
If I have a field that accepts rating numbers and a N/A in my Access 2003 database.

Choose rating: 1 2 3 N/A


N/A is not suppose to show anything in my database and 1 should show the number 1 and 2 the number 2 and the 3 the number 3.

Question is what would the data type be for this field??

I used text data type and it accepts the blank entry in my insert statement but when I changed it to Number data type it doesnt accept the blank ("") entry into the database.

Please advise.

Anyway I can get the number data type to accept a blank entry???
 
why not use zero or 999 for the blanks?

There is also a setting in the table design you can enable to 'Allow Zero-Length Strings' (although I'm not sure this is there for number fields)

Good Luck,

Alex

Ignorance of certain subjects is a great part of wisdom
 
If you want numerics to appear as empty (i.e. blank) fields then make sure that, in the definition of the field, the "Required" property is set to No and there's nothing in the "Default Value" property.

Then when you add a new record set the field to NULL or don't bother to set it at all.

For example
Code:
INSERT INTO myTable (Rating1, Rating2, Rating3, Rating4)
VALUES ( 1, 2, 3, NULL)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top