autonumberwon't let me get back to #1

G

Guest

I have created four tables all of which are linked by an order id
#(autonumber data type). Two of the tables, orders and order detail are
linked via order id # and, on the order input form, the order detail
information is in the subform. The master and child are linked via the order
id # and some others not relevant to this problem. I entered some data to
test that the master/child links were working then undid the entries. Now,
the autonumber in the order portion won't go back to one and, to top it off,
the order id # in the subform is different from the order id # up top.

I tried deleting the relationships then changing the data type and saving.
But when I changed them back to the autonumber it still started at 4 up top
and 2 in the subform. How do I correct this?

AND, if I have four tables joined by the order id (autonumber data type) how
can I make sure that each record has one and only one order id #??? I need
that same order id # when the shipping and shipping detail information is
completed on the second page of the data entry form - and this is hardly ever
entered at the same time as the initial order info.
 
J

John Vinson

I have created four tables all of which are linked by an order id
#(autonumber data type).

BIG mistake.

An Autonumber has one purpose, and one purpose only: to provide a
unique Primary Key value. Once an autonumber is used, it's used up and
will not be assigned again, even if you cancel that record one second
after dirtying the form.

Your foreign keys in the related tables must NOT be Autonumbers;
instead, use Long Integers.

It's probably not necessary to use one-to-one relationships here - why
not just put the shipping and other information directly in the order
table, if it will never have multiple records?

John W. Vinson[MVP]
 

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

Similar Threads

Click a subform field to open relevant form 5
Form/Report Relationship 24
Cant edit subform within a form 3
Form Problem 1
Subform linking problem 4
LinkMasterFields Error 16
New order subform 1
Form Error Msg 1

Top