473,385 Members | 1,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Updating 2 tables in 1 to Many

Apologies for the Subject Heading!

I am working on a small invoicing app for a local Tyre and Exhaust
Centre. They want to be able to type in the Vehicle Registration
Number and it automatically bring up the customers name and address.
This in itself seems fairly straightforward except that 1 customer can
have many vehicles.

My tables are set up as follows:

TblCustomer (CustID as PK) in one to many with tblVehicle (VehicleID
as PK and CustID as FK)
tblVehicle (VehicleID as PK and CustID as FK) in one to may with
tblInvoice (InvoiceID as PK and VehicleID asFK)
tblInvoice (InvoiceID as PK and VehicleID asFK) in one to many with
tblInvoiceDetail (InvoiceDetailID as PK and InvoiceID as FK)

I thought of using a combobox and NotInList but don't know how to get
the data in both tables updated. There are other issues like change
of ownership etc.

Can anyone give any pointers? Thanks in advance for any help.
Nov 13 '05 #1
3 1320
Each customer may have more than 1 vehicle, but each vehicle's ID
should correspond to a CustomerID in tblVehicle. Creating a query
with VehicleID as input value will pull correspnding Customer info
from tblCustomer.

What data needs to be updated, thought you just needed to pull
customer info. With change of ownership do they still need old owner
info linked to the car, can they just delete the old info.
da**************@talk21.com (David Mitchell) wrote in message news:<c3*************************@posting.google.c om>...
Apologies for the Subject Heading!

I am working on a small invoicing app for a local Tyre and Exhaust
Centre. They want to be able to type in the Vehicle Registration
Number and it automatically bring up the customers name and address.
This in itself seems fairly straightforward except that 1 customer can
have many vehicles.

My tables are set up as follows:

TblCustomer (CustID as PK) in one to many with tblVehicle (VehicleID
as PK and CustID as FK)
tblVehicle (VehicleID as PK and CustID as FK) in one to may with
tblInvoice (InvoiceID as PK and VehicleID asFK)
tblInvoice (InvoiceID as PK and VehicleID asFK) in one to many with
tblInvoiceDetail (InvoiceDetailID as PK and InvoiceID as FK)

I thought of using a combobox and NotInList but don't know how to get
the data in both tables updated. There are other issues like change
of ownership etc.

Can anyone give any pointers? Thanks in advance for any help.

Nov 13 '05 #2
da**************@talk21.com (David Mitchell) wrote in message news:<c3*************************@posting.google.c om>...
Apologies for the Subject Heading!

I am working on a small invoicing app for a local Tyre and Exhaust
Centre. They want to be able to type in the Vehicle Registration
Number and it automatically bring up the customers name and address.
This in itself seems fairly straightforward except that 1 customer can
have many vehicles.

My tables are set up as follows:

TblCustomer (CustID as PK) in one to many with tblVehicle (VehicleID
as PK and CustID as FK)
tblVehicle (VehicleID as PK and CustID as FK) in one to may with
tblInvoice (InvoiceID as PK and VehicleID asFK)
tblInvoice (InvoiceID as PK and VehicleID asFK) in one to many with
tblInvoiceDetail (InvoiceDetailID as PK and InvoiceID as FK)

I thought of using a combobox and NotInList but don't know how to get
the data in both tables updated. There are other issues like change
of ownership etc.

Can anyone give any pointers? Thanks in advance for any help.


This question appears to be backwards. If a vehicle can only belong
to ONE owner, then nothing to it. You can do something like load the
combobox with multiple columns...
SELECT Vehicle.VIN, Owner.LastName
FROM Vehicle INNER JOIN Owner ON Vehicle.OwnerID=Owner.OwnerID
ORDER BY Vehicle.VIN, Owner.LastName;

and then refer to the hidden columns in your combobox...

me.cboVIN.Columns(0) <==VIN
me.cboVIN.Columns(1) <==Owner.LastName
Nov 13 '05 #3
Thanks for both your answers, how would I deal with new vehicle
registrations not on the system (for existing and new customers)?
Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Robin Tucker | last post by:
Hi there, I have a database on my test machine that will need to be installed on users machines. I would like to create the database with the given schema on the users machine and also with...
1
by: Chris Jackson | last post by:
I'm a novice Access user and am not sure how to solve the following problem. Any help with the following would be greatly appreciated! I have two tables with identical structures, the first holds...
1
by: gaosul | last post by:
I am non-programming scientist and I am using a Program called Easyarticles from Synaptosoft Inc., which is based the database program Access. Unfortunately, the owner of this company has...
10
by: jaYPee | last post by:
does anyone experienced slowness when updating a dataset using AcceptChanges? when calling this code it takes many seconds to update the database SqlDataAdapter1.Update(DsStudentCourse1)...
34
by: Jeff | last post by:
For years I have been using VBA extensively for updating data to tables after processing. By this I mean if I had to do some intensive processing that resulted in data in temp tables, I would have...
4
by: Geoff | last post by:
Hi I'm hoping somebody can help me with the following problem that has occurred to me. Suppose I have two tables in an SQL Server database. Let's call these tables A and B. Assume that A has...
2
by: susan.f.barrett | last post by:
Hi, Despite me being able to type the following in to SQL Server and it updating 1 row: > updatestockcategory 1093, 839 In my code, it is not updating any rows. dataSet = new DataSet();
6
by: OldBirdman | last post by:
I don't really know how to state this problem, as it doesn't make any sense to me. I have a simple "One-to-Many" query, and was updating the Many side. It quit working. I cannot make any changes...
6
by: Richard Penfold | last post by:
Can someone explain why a field on the many side of a one-to-many relationship, with referential integrity enforced, is not automatically updating? I have 5 tables in my database with the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.