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. |