Relationship problem?

C

Canice Diaz

Help needed please. This sounds very basic but I'm a newbie to Access VB.
I'm using Access XP. I have three tables with fields below as example:

1. tblOwner
ownerID PK(Autonumber)
name
Address
TelNo
2. tblLicense
LicenseID PK(Autonumber)
OwnerID FK
LicenseNbr
DateIssued
DateExpired
3. tblMachines
machineID PK(Autonumber)
LicenseID FK
SerialNbr

Table Owner can have many licenses (1 to many). Table License can have many
machines (1 to many). What I'm trying to do is whenever a new
license number (LicenseNbr) is added, I need to have the table machine
create a new set of records based on the new license number. I've created a
main form for the tblOwner with two subforms but I'm having trouble with
related records on the tblLicense. Any help will be very much appreciated.
Thanks in advance.

Canice
 
J

John Vinson

What I'm trying to do is whenever a new
license number (LicenseNbr) is added, I need to have the table machine
create a new set of records based on the new license number. I've created a
main form for the tblOwner with two subforms but I'm having trouble with
related records on the tblLicense.

It's VERY rare that you would want to create empty "placeholder"
records in this way. They have a nasty habit of never getting filled
in!

It sounds like you instead need to have either a Form (Owner) -
Subform (License) - Sub-Subform (Machine) relationship; or have the
Machine subform logically a subform of the License subform. You can do
this by setting the Master Link Field property of the Machines form to

Forms!frmOwners!subLicenses.Form!LicenseNbr

and the Child Link Field to the LicenseNbr foreign key field.

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 

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