By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,608 Members | 1,940 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,608 IT Pros & Developers. It's quick & easy.

Inserting a new Record in sub-table and ensuring valid relationship values

P: n/a
I'm trying to create a DB that will keep track of various vehicles and
the servicing that each vehicle has done to it.

i.e. I have two tables 1 = Vehicles, Fields = VehicleID, Registration,
Manufacrure, Model etc

2 table = Services, Fields = ServiceID, VehicleID (Foreign Key),
Servicedate, Description etc

I've done all the relationships and also created a form for each table
and also setup a button on the vehicle form so that when I click that
button it brings up all the service records for that vehicle.

The question I have is how do I then add a new service record from the
services i.e. how do I get the VehicleID from the main form so that I
can set the value into the Services table to ensure I keep correct
relatiosnhips ?

Thank You

Elfyn

Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

<el***@ibabyshop.co.uk> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
I'm trying to create a DB that will keep track of various vehicles and
the servicing that each vehicle has done to it.

i.e. I have two tables 1 = Vehicles, Fields = VehicleID, Registration,
Manufacrure, Model etc

2 table = Services, Fields = ServiceID, VehicleID (Foreign Key),
Servicedate, Description etc

I've done all the relationships and also created a form for each table
and also setup a button on the vehicle form so that when I click that
button it brings up all the service records for that vehicle.

The question I have is how do I then add a new service record from the
services i.e. how do I get the VehicleID from the main form so that I
can set the value into the Services table to ensure I keep correct
relatiosnhips ?

Thank You

Elfyn

The trick to this is to add a subform. You go to the vehicle on the
vehicles form and add a service record in the subform below (the vehicle ID
will be automatically entered). This is not the only way, but may be the
simplest to start you off. Let us know if you have any difficulties with
this.
Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.