Copy id

  • Thread starter Thread starter Swagener
  • Start date Start date
S

Swagener

Hi ,
I have a main form where new records are added, one of those fields is
a autonumber which is a primary key. The user will fill out all the
fields and open the next form which is bound to a different table but
has a Foreign key of the last table (which will be blank as its a new
record in the main table) , i can't figure out how to copy the id from
the first form and paste it onto the next form in the foreign key field
on openevent.

Thanks,
Riq
 
It's a bit hard to understand your question, but from what I can tell you
want the primary key from the main form's record source to appear in the
foreign key field of a child record. If you have a one-to-many relationship
set up between MainID (PK autonumber) in the main table (tblMain) and MainID
in another table (tblOther), build a form based on tblMain with a subform
based on tblOther. Because of the relationship, any records created through
the subform will contain the same value in MainID as does the record created
through the main form.
 
No the problem is:
tblone has one autonumber field as primary key and the
tblother has a normal long integar field.

The quest is that people will use the main form based on tbleone to add
new customers
and will open another form (based on tblother) to add more extra
details in which the same id key needs to added.
 
I see that there is another active thread on this topic, so I will not post
further in this thread. However, what you have described is exactly the
reason to use form/subform.
 
Back
Top