Storing an Id in multiple tables

G

Guest

I have a database that has two tables, Leases and Payment History. I need
the Autonumber "Lease Id" to store as a new record under a field "Lease Id"
in the Payment History table(thereby creating a new payment Id).
 
D

Douglas J. Steele

That's not a recommended approach.

There's no point saving a dummy record in the Payment History table. Don't
create the new record until you have something to store in it.
 
J

John W. Vinson

I have a database that has two tables, Leases and Payment History. I need
the Autonumber "Lease Id" to store as a new record under a field "Lease Id"
in the Payment History table(thereby creating a new payment Id).

Don't bother. Instead, just have the Payments table contain a Long Integer
LeaseID field, and use a Form based on the Leases table with a subform based
on the Payments table; use the LeaseID as the master/child link field.

A new record will be created which will automatically inherit the lease ID at
the moment that data is entered on the subform. You don't need a pre-existing
record.

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

Top