TRYING TO CREATE AUTONUMBER FIELD

S

Selee

I imported a large Approach DBF file into Access 2007. I set up my data
entry form for the new table. On my old Approach form we had a field
"Sample Number". When you started the database, the input form came up.When
you click on the sample number field, a new sample number appeared which was
the previous record sample number +1. Seems simple enough. No validation
was required and Approach listed the field as a field box, numeric, auto
number-serial.

Ok when I bound this field to the new table field in Access, I set it up as
a numeric field box. I tried to set it for auto number but since there were
previous entries, Access wouldn't allow it. Anyway, I tried finding a way
to increase the last record sample number by 1. I've set up the expression
for the control source field many different ways but nothing works. Can
anyone tell me how to take the [sample_no_] bound field and set it to
increment by one when someone clicks to input a new record?

Is this possible?
 
G

Guest

I tried to set it for auto number but since there were previous entries,
Access wouldn't allow it.
You can copy your table structure to a new table and set the field as
Autonumber. Do a Compact and Repair. Then append to the new table. You can
append numbers to the autonumber field if that number has not been inputted
earlier.
 
S

Selee

I did what you suggested. It worked fine except for the fact that I wanted
to keep the existing numbers from my old DBF which start at 8090 and Access
assigned numbers starting at 1. We wondered whether we could add another
field and put a default value of 8089 in it and then write a formula to put
in the autonumber field adding the two together. Can this be done in an
autonumber field?

Seems a lot more complicated than it needs to be.



KARL DEWEY said:
Access wouldn't allow it.
You can copy your table structure to a new table and set the field as
Autonumber. Do a Compact and Repair. Then append to the new table. You
can
append numbers to the autonumber field if that number has not been
inputted
earlier.
--
KARL DEWEY
Build a little - Test a little


Selee said:
I imported a large Approach DBF file into Access 2007. I set up my data
entry form for the new table. On my old Approach form we had a field
"Sample Number". When you started the database, the input form came
up.When
you click on the sample number field, a new sample number appeared which
was
the previous record sample number +1. Seems simple enough. No
validation
was required and Approach listed the field as a field box, numeric, auto
number-serial.

Ok when I bound this field to the new table field in Access, I set it up
as
a numeric field box. I tried to set it for auto number but since there
were
previous entries, Access wouldn't allow it. Anyway, I tried finding a
way
to increase the last record sample number by 1. I've set up the
expression
for the control source field many different ways but nothing works. Can
anyone tell me how to take the [sample_no_] bound field and set it to
increment by one when someone clicks to input a new record?

Is this possible?
 
G

Guest

You should have been able to append your old numbers into the autonumber
field. Did they not append in?
All new records after that should increment from your highest number.

--
KARL DEWEY
Build a little - Test a little


Selee said:
I did what you suggested. It worked fine except for the fact that I wanted
to keep the existing numbers from my old DBF which start at 8090 and Access
assigned numbers starting at 1. We wondered whether we could add another
field and put a default value of 8089 in it and then write a formula to put
in the autonumber field adding the two together. Can this be done in an
autonumber field?

Seems a lot more complicated than it needs to be.



KARL DEWEY said:
I tried to set it for auto number but since there were previous entries,
Access wouldn't allow it.
You can copy your table structure to a new table and set the field as
Autonumber. Do a Compact and Repair. Then append to the new table. You
can
append numbers to the autonumber field if that number has not been
inputted
earlier.
--
KARL DEWEY
Build a little - Test a little


Selee said:
I imported a large Approach DBF file into Access 2007. I set up my data
entry form for the new table. On my old Approach form we had a field
"Sample Number". When you started the database, the input form came
up.When
you click on the sample number field, a new sample number appeared which
was
the previous record sample number +1. Seems simple enough. No
validation
was required and Approach listed the field as a field box, numeric, auto
number-serial.

Ok when I bound this field to the new table field in Access, I set it up
as
a numeric field box. I tried to set it for auto number but since there
were
previous entries, Access wouldn't allow it. Anyway, I tried finding a
way
to increase the last record sample number by 1. I've set up the
expression
for the control source field many different ways but nothing works. Can
anyone tell me how to take the [sample_no_] bound field and set it to
increment by one when someone clicks to input a new record?

Is this possible?
 
S

Selee

No, Access renumbered them all starting with 1. The other idea didn't work
either. I don't know what I'm doing wrong.


KARL DEWEY said:
You should have been able to append your old numbers into the autonumber
field. Did they not append in?
All new records after that should increment from your highest number.

--
KARL DEWEY
Build a little - Test a little


Selee said:
I did what you suggested. It worked fine except for the fact that I
wanted
to keep the existing numbers from my old DBF which start at 8090 and
Access
assigned numbers starting at 1. We wondered whether we could add another
field and put a default value of 8089 in it and then write a formula to
put
in the autonumber field adding the two together. Can this be done in an
autonumber field?

Seems a lot more complicated than it needs to be.



KARL DEWEY said:
I tried to set it for auto number but since there were previous
entries,
Access wouldn't allow it.
You can copy your table structure to a new table and set the field as
Autonumber. Do a Compact and Repair. Then append to the new table.
You
can
append numbers to the autonumber field if that number has not been
inputted
earlier.
--
KARL DEWEY
Build a little - Test a little


:

I imported a large Approach DBF file into Access 2007. I set up my
data
entry form for the new table. On my old Approach form we had a field
"Sample Number". When you started the database, the input form came
up.When
you click on the sample number field, a new sample number appeared
which
was
the previous record sample number +1. Seems simple enough. No
validation
was required and Approach listed the field as a field box, numeric,
auto
number-serial.

Ok when I bound this field to the new table field in Access, I set it
up
as
a numeric field box. I tried to set it for auto number but since
there
were
previous entries, Access wouldn't allow it. Anyway, I tried finding a
way
to increase the last record sample number by 1. I've set up the
expression
for the control source field many different ways but nothing works.
Can
anyone tell me how to take the [sample_no_] bound field and set it to
increment by one when someone clicks to input a new record?

Is this possible?
 
S

Selee

I'm sorry, I forgot something. It also did not append the next number when
you go to a new record. In the sample no. box it just sayd (new).


KARL DEWEY said:
You should have been able to append your old numbers into the autonumber
field. Did they not append in?
All new records after that should increment from your highest number.

--
KARL DEWEY
Build a little - Test a little


Selee said:
I did what you suggested. It worked fine except for the fact that I
wanted
to keep the existing numbers from my old DBF which start at 8090 and
Access
assigned numbers starting at 1. We wondered whether we could add another
field and put a default value of 8089 in it and then write a formula to
put
in the autonumber field adding the two together. Can this be done in an
autonumber field?

Seems a lot more complicated than it needs to be.



KARL DEWEY said:
I tried to set it for auto number but since there were previous
entries,
Access wouldn't allow it.
You can copy your table structure to a new table and set the field as
Autonumber. Do a Compact and Repair. Then append to the new table.
You
can
append numbers to the autonumber field if that number has not been
inputted
earlier.
--
KARL DEWEY
Build a little - Test a little


:

I imported a large Approach DBF file into Access 2007. I set up my
data
entry form for the new table. On my old Approach form we had a field
"Sample Number". When you started the database, the input form came
up.When
you click on the sample number field, a new sample number appeared
which
was
the previous record sample number +1. Seems simple enough. No
validation
was required and Approach listed the field as a field box, numeric,
auto
number-serial.

Ok when I bound this field to the new table field in Access, I set it
up
as
a numeric field box. I tried to set it for auto number but since
there
were
previous entries, Access wouldn't allow it. Anyway, I tried finding a
way
to increase the last record sample number by 1. I've set up the
expression
for the control source field many different ways but nothing works.
Can
anyone tell me how to take the [sample_no_] bound field and set it to
increment by one when someone clicks to input a new record?

Is this possible?
 

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