Double number format

B

Ben Wiegert

I have an Access Database which uses numeric doubles when
setting up Record IDs for each record. Why does a field
set up as numeric/double turn everything over 11 numbers
into scientific notation, and is there a way around this?
 
V

Van T. Dinh

Doubles are approximations and not recommended for RecordIDs.

Use AutoNumber or Long instead.

HTH
Van T. Dinh
MVP (Access)
 
B

Ben Wiegert

Thank you very much for responding.

I would like to do what you suggest but I have inherited
this system as is. Our record ID's start with the number
of the company so the first record in a table for company
1 would be 10000000001, company 2 would be 20000000001.
This works great for companies 1 thru 9 but then we have
problems. When we want a company 10 we get scientific
notation. Long integers are only 11 long as well.

Do you have any other suggestions? Can we use a text
field for recordIDs? Our recordIDs are being generated by
our program looking the next id stored in a file, then
adding to it and updating it for the next record that is
added.
 
J

John Vinson

Do you have any other suggestions? Can we use a text
field for recordIDs? Our recordIDs are being generated by
our program looking the next id stored in a file, then
adding to it and updating it for the next record that is
added.

Two suggestions:

- Use Text rather than number

- Perhaps better, use a TWO field primary key, with the CompanyID and
a numeric (Long Integer) sequential ID. Concatenate them in a Query or
in the control source of a form/report textbox for display, but store
them as two fields.
 

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