A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Table/Query Lookup



 
 
Thread Tools Display Modes
  #1  
Old January 4th, 2006, 08:24 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Table/Query Lookup

I am trying to populate a field in access called “quoted to” which will
include several customers. I am using a table/query to look up the customers
in a separate table called customers. So far I am only able to put 1 customer
in this field. Does anyone know if I can put multiple customer names in the
same field in this manner.
  #2  
Old January 4th, 2006, 08:57 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Table/Query Lookup

Sounds like you need a third table commonly called a bridging or
cross-reference table. You have a many-to-many relationship with one quote
for many customers and a customer can have many quotes. Therefore you need
this third table that contains a foriegn key from the quotes table and also
the customer FK.

Actually what you might need is a copy of Database Design for Mere Mortals
by Hernandez to explain this concept better than I can in this short space.
--
Jerry Whittle
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"F. M. Tom" wrote:

I am trying to populate a field in access called “quoted to” which will
include several customers. I am using a table/query to look up the customers
in a separate table called customers. So far I am only able to put 1 customer
in this field. Does anyone know if I can put multiple customer names in the
same field in this manner.

  #3  
Old January 4th, 2006, 09:15 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Table/Query Lookup

I will look for the book. Can you tell me what you mean by "customer FK"?

"Jerry Whittle" wrote:

Sounds like you need a third table commonly called a bridging or
cross-reference table. You have a many-to-many relationship with one quote
for many customers and a customer can have many quotes. Therefore you need
this third table that contains a foriegn key from the quotes table and also
the customer FK.

Actually what you might need is a copy of Database Design for Mere Mortals
by Hernandez to explain this concept better than I can in this short space.
--
Jerry Whittle
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"F. M. Tom" wrote:

I am trying to populate a field in access called “quoted to” which will
include several customers. I am using a table/query to look up the customers
in a separate table called customers. So far I am only able to put 1 customer
in this field. Does anyone know if I can put multiple customer names in the
same field in this manner.

  #4  
Old January 4th, 2006, 11:19 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Table/Query Lookup

On Wed, 4 Jan 2006 12:24:03 -0800, F. M. Tom
wrote:

I am trying to populate a field in access called quoted to which will
include several customers. I am using a table/query to look up the customers
in a separate table called customers. So far I am only able to put 1 customer
in this field. Does anyone know if I can put multiple customer names in the
same field in this manner.


If you have a Many (quotes) to Many (customers) relationship, you need
THREE tables. You cannot put multiple customers in one field!

A possible design would be

Quotes
QuoteID Primary Key this might be your unique Quote Number
information about the quote

Customers
CustomerID Primary Key perhaps an autonumber
LastName
FirstName
other bio and contact information

CustomerQuotes
QuoteID link to Quotes
CustomerID link to Customers
any fields needed to store information about THIS quote for THIS
customer, e.g. a yes/no field for accepted, a memo field for comments,
a quote date, etc.

To do data entry, you'ld use a Form for Quotes with a Subform based on
CustomerQuotes. There'd be a CustomerID combo box on the subform to
select the customer; for a multi-customer quote you'ld just add
multiple rows.

John W. Vinson[MVP]
  #5  
Old January 5th, 2006, 02:13 AM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Table/Query Lookup

I just applied a dope slap up the side of my head. I should explain
abbreviations. FK stands for Foreign Key and PK stands for Primary Key. A
primary key is a field or set of fields that uniquely identifies a record in
a table. Say that Jerry is CustomerID 1 and CustomerID is the primary key.

Now a Customer can have many Quotes. To link these two tables together I'll
have a CustomerID_FK field in the Quotes table and put the number 1 in each
of Jerry's quotes. That way we can link these two tables together. This is
the ideal one-to-many ( 1-M ) relationship.

Your problem is that not only can a Customer have many Quotes, a Quote may
have many Customers. That's the dreaded Many-to-Many ( M-M ) relationship.
The way to handle this is a bridging, linking, or cross-reference table (all
names for same thing). That way you have something like this:

Customer Link Quotes
1 - M - 1

This concept is better presented in the book along with nicer graphics!
--
Jerry Whittle
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"F. M. Tom" wrote:

I will look for the book. Can you tell me what you mean by "customer FK"?

"Jerry Whittle" wrote:

Sounds like you need a third table commonly called a bridging or
cross-reference table. You have a many-to-many relationship with one quote
for many customers and a customer can have many quotes. Therefore you need
this third table that contains a foriegn key from the quotes table and also
the customer FK.

Actually what you might need is a copy of Database Design for Mere Mortals
by Hernandez to explain this concept better than I can in this short space.
--
Jerry Whittle
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"F. M. Tom" wrote:

I am trying to populate a field in access called “quoted to” which will
include several customers. I am using a table/query to look up the customers
in a separate table called customers. So far I am only able to put 1 customer
in this field. Does anyone know if I can put multiple customer names in the
same field in this manner.

  #6  
Old January 5th, 2006, 01:56 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Table/Query Lookup

Thanks, Jerry - I should appologize to you for not knowing the abbreviations.
My son found he has access to the book on line and I looked at the first two
chapters last night and will get more into it tonight.

"Jerry Whittle" wrote:

I just applied a dope slap up the side of my head. I should explain
abbreviations. FK stands for Foreign Key and PK stands for Primary Key. A
primary key is a field or set of fields that uniquely identifies a record in
a table. Say that Jerry is CustomerID 1 and CustomerID is the primary key.

Now a Customer can have many Quotes. To link these two tables together I'll
have a CustomerID_FK field in the Quotes table and put the number 1 in each
of Jerry's quotes. That way we can link these two tables together. This is
the ideal one-to-many ( 1-M ) relationship.

Your problem is that not only can a Customer have many Quotes, a Quote may
have many Customers. That's the dreaded Many-to-Many ( M-M ) relationship.
The way to handle this is a bridging, linking, or cross-reference table (all
names for same thing). That way you have something like this:

Customer Link Quotes
1 - M - 1

This concept is better presented in the book along with nicer graphics!
--
Jerry Whittle
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"F. M. Tom" wrote:

I will look for the book. Can you tell me what you mean by "customer FK"?

"Jerry Whittle" wrote:

Sounds like you need a third table commonly called a bridging or
cross-reference table. You have a many-to-many relationship with one quote
for many customers and a customer can have many quotes. Therefore you need
this third table that contains a foriegn key from the quotes table and also
the customer FK.

Actually what you might need is a copy of Database Design for Mere Mortals
by Hernandez to explain this concept better than I can in this short space.
--
Jerry Whittle
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"F. M. Tom" wrote:

I am trying to populate a field in access called “quoted to” which will
include several customers. I am using a table/query to look up the customers
in a separate table called customers. So far I am only able to put 1 customer
in this field. Does anyone know if I can put multiple customer names in the
same field in this manner.

  #7  
Old January 9th, 2006, 10:10 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Table/Query Lookup

I have set up the 3rd table and I have an input form designed. Can you tell
me how I will be able to add more than one customer to the quoted to field
and how it will be stored in the database. I have used access a little but
nothing this complex before. I was using a program on my palm which would let
me enter more than one name in the "quoted to" field. Thanks in advance for
any help you can give me or any publications you can refer me to. As I
remember Access for Dummies does not go this deep.

"John Vinson" wrote:

On Wed, 4 Jan 2006 12:24:03 -0800, F. M. Tom
wrote:

I am trying to populate a field in access called “quoted to” which will
include several customers. I am using a table/query to look up the customers
in a separate table called customers. So far I am only able to put 1 customer
in this field. Does anyone know if I can put multiple customer names in the
same field in this manner.


If you have a Many (quotes) to Many (customers) relationship, you need
THREE tables. You cannot put multiple customers in one field!

A possible design would be

Quotes
QuoteID Primary Key this might be your unique Quote Number
information about the quote

Customers
CustomerID Primary Key perhaps an autonumber
LastName
FirstName
other bio and contact information

CustomerQuotes
QuoteID link to Quotes
CustomerID link to Customers
any fields needed to store information about THIS quote for THIS
customer, e.g. a yes/no field for accepted, a memo field for comments,
a quote date, etc.

To do data entry, you'ld use a Form for Quotes with a Subform based on
CustomerQuotes. There'd be a CustomerID combo box on the subform to
select the customer; for a multi-customer quote you'ld just add
multiple rows.

John W. Vinson[MVP]

  #8  
Old January 10th, 2006, 07:03 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Table/Query Lookup

On Mon, 9 Jan 2006 14:10:05 -0800, F. M. Tom
wrote:

I have set up the 3rd table and I have an input form designed. Can you tell
me how I will be able to add more than one customer to the quoted to field
and how it will be stored in the database.


You do NOT want to "add more than one customer to the quoted to
field".

Relational databases DO NOT WORK THAT WAY. Fields should be "atomic",
having only one value.

I have used access a little but
nothing this complex before. I was using a program on my palm which would let
me enter more than one name in the "quoted to" field. Thanks in advance for
any help you can give me or any publications you can refer me to. As I
remember Access for Dummies does not go this deep.


The Dummies book seems to be ok for people using existing Access
databases, but (by design) doesn't deal with relational design or
database creation.

Rather than trying to store multiple names in one field, please
investigate my suggestion. It's standard practice, and it works well.

Quotes
QuoteID Primary Key this might be your unique Quote Number
information about the quote

Customers
CustomerID Primary Key perhaps an autonumber
LastName
FirstName
other bio and contact information

CustomerQuotes
QuoteID link to Quotes
CustomerID link to Customers
any fields needed to store information about THIS quote for THIS
customer, e.g. a yes/no field for accepted, a memo field for comments,
a quote date, etc.

To do data entry, you'ld use a Form for Quotes with a Subform based on
CustomerQuotes. There'd be a CustomerID combo box on the subform to
select the customer; for a multi-customer quote you'ld just add
multiple rows.

John W. Vinson[MVP]



John W. Vinson[MVP]
  #9  
Old January 10th, 2006, 10:11 PM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Table/Query Lookup


To do data entry, you'ld use a Form for Quotes with a Subform based on
CustomerQuotes. There'd be a CustomerID combo box on the subform to
select the customer; for a multi-customer quote you'ld just add
multiple rows.


John - The above paragraph is what I have been trying to do. I agree with
all that you have said. I have set up the "customer quotes" table but am
having trouble setting up the subform or even a form that will let me add
more than one customer to the quoted to form. This is what I am looking for
help on. - Thanks

"John Vinson" wrote:

On Mon, 9 Jan 2006 14:10:05 -0800, F. M. Tom
wrote:

I have set up the 3rd table and I have an input form designed. Can you tell
me how I will be able to add more than one customer to the quoted to field
and how it will be stored in the database.


You do NOT want to "add more than one customer to the quoted to
field".

Relational databases DO NOT WORK THAT WAY. Fields should be "atomic",
having only one value.

I have used access a little but
nothing this complex before. I was using a program on my palm which would let
me enter more than one name in the "quoted to" field. Thanks in advance for
any help you can give me or any publications you can refer me to. As I
remember Access for Dummies does not go this deep.


The Dummies book seems to be ok for people using existing Access
databases, but (by design) doesn't deal with relational design or
database creation.

Rather than trying to store multiple names in one field, please
investigate my suggestion. It's standard practice, and it works well.

Quotes
QuoteID Primary Key this might be your unique Quote Number
information about the quote

Customers
CustomerID Primary Key perhaps an autonumber
LastName
FirstName
other bio and contact information

CustomerQuotes
QuoteID link to Quotes
CustomerID link to Customers
any fields needed to store information about THIS quote for THIS
customer, e.g. a yes/no field for accepted, a memo field for comments,
a quote date, etc.

To do data entry, you'ld use a Form for Quotes with a Subform based on
CustomerQuotes. There'd be a CustomerID combo box on the subform to
select the customer; for a multi-customer quote you'ld just add
multiple rows.

John W. Vinson[MVP]



John W. Vinson[MVP]

  #10  
Old January 11th, 2006, 02:30 AM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Table/Query Lookup

On Tue, 10 Jan 2006 14:11:02 -0800, F. M. Tom
wrote:

To do data entry, you'ld use a Form for Quotes with a Subform based on
CustomerQuotes. There'd be a CustomerID combo box on the subform to
select the customer; for a multi-customer quote you'ld just add
multiple rows.


John - The above paragraph is what I have been trying to do. I agree with
all that you have said. I have set up the "customer quotes" table but am
having trouble setting up the subform or even a form that will let me add
more than one customer to the quoted to form. This is what I am looking for
help on. - Thanks


Please post the following information:

The Recordsource properties of your mainform and subform (show the SQL
view of the query if it's a query)
The Primary Key of each table
The RowSource of the combo box (post the SQL)
The Control Source and Bound Column of the combo box

John W. Vinson[MVP]
 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Lookup tables Wind54Surfer General Discussion 15 August 11th, 2005 12:54 AM
Lookup Vector > Lookup Value Alec Kolundzic Worksheet Functions 6 June 10th, 2005 02:14 PM
lookup vs combo box Scubaman General Discussion 4 June 7th, 2005 02:02 AM
Lookup fields on label report Howard Setting Up & Running Reports 1 June 3rd, 2004 02:43 AM
Lookup fields - what's wrong with them? NATHAN SANDERS New Users 2 May 4th, 2004 10:51 AM


All times are GMT +1. The time now is 07:07 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright 2004-2024 OfficeFrustration.
The comments are property of their posters.