Connecting Tech Pros Worldwide Help | Site Map
 
 
LinkBack Thread Tools Search this Thread
  #1  
Old November 13th, 2005, 08:23 AM
elfyn@ibabyshop.co.uk
Guest
 
Posts: n/a
Default Inserting a new Record in sub-table and ensuring valid relationship values

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




  #2  
Old November 13th, 2005, 08:23 AM
Stefan Kowalski
Guest
 
Posts: n/a
Default Re: Inserting a new Record in sub-table and ensuring valid relationship values


<elfyn@ibabyshop.co.uk> wrote in message
news:1108379516.982873.135340@o13g2000cwo.googlegr oups.com...[color=blue]
> 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
>[/color]


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.


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 205,414 network members.