Subform autonumber needed for parent form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a parent form which is tied to a table of inspection data. I have a
subform on that parent form which is tied to the serial record for the
inspection. Here's my problem. I have the relationship set up so that the
primary key, SerID, from the serial record is on the inspection data record
as a one to many. We keeps inspection data for 7 years along with one serial
record. I want the SerID on the Inspection data record but don't know how to
get it there because it's an autonumber. When the form is opened for add i
can enter the new serial record but I can't enter the inspection data because
it says there no record in table. Which is correct. So how do I get this
SerID on the parent table?
 
McDal said:
I have a parent form which is tied to a table of inspection data. I have a
subform on that parent form which is tied to the serial record for the
inspection. Here's my problem. I have the relationship set up so that the
primary key, SerID, from the serial record is on the inspection data record
as a one to many. We keeps inspection data for 7 years along with one serial
record. I want the SerID on the Inspection data record but don't know how to
get it there because it's an autonumber. When the form is opened for add i
can enter the new serial record but I can't enter the inspection data because
it says there no record in table. Which is correct. So how do I get this
SerID on the parent table?


The parent (Serial) record should have the AutoNumber
primary key. The child (inspection) records would have
their SerID field as a Long, **not** an AutoNumber.

If you set the cubform control's Link Master/Child
properties to the SerID field in both tables, it will be set
automatically whenever you add a new inspection record.
 
I understand completely what you are saying and I've done that in prior
forms. This form is a little different with the Serial record being the
subform (child) and the parent form being the inspection data. See, there's
one serial number but years of inspection data. Every year we need new
inspection data, but don't want to type the serial record over, that would be
redundant.

Any other suggestions?
 
I guess that's what you said in your original question, but,
since I don't understand what you're trying to do, I
tranposed the roles of the form/subform.

Sorry about that, I should have asked you to explain more
about how the tables are related. I haven't been able to
figure out what your tables primary keys and their related
foreign keys are, nor which one you want to apply to which
table.
 
I just had a long fight with a similar problem. You talked about Parent and
Child forms...I assume those are also Parent and Child tables. I re-made my
child table several times before getting it right. In the make table query I
included the autonumber id from the parent..and I made the table. Then I
changed that field to a number long integer field. When saving I let the
program add a newPrimary key auto number. I am relating one person to many
dates similar to what you described. The primary key Parent relates to the
foreign key on the child that you brought over from the Parent table.
 
Back
Top