Using Lookup in Tables

G

Guest

I have two tables Acct Codes and Batches. Account Codes has two fields,
account and Description. The realtionship is:

[Account Codes.account] has a 1-to-many to [Batches].acct

How do I use a lookup so that when a user inputs data in [Batches].acct, the
[Batches].description is automatically updated to reflect the value of the
related [Account Codes].description?

thanks,
 
D

Douglas J. Steele

Realistically, you shouldn't be storing the Description in the Batches
table. That's a violation of database normalization principles.

You've got acct in Batches: use that to link the two tables, and get the
description from Account Codes, where it belongs.
 
G

Guest

Thank you Doug,

I have removed the Description column from the Batches table.

How do I used this in a form so that when user enter Account Codes, the
Description field is auto updated to reflect the description of the account
code?

Thanks!

Douglas J. Steele said:
Realistically, you shouldn't be storing the Description in the Batches
table. That's a violation of database normalization principles.

You've got acct in Batches: use that to link the two tables, and get the
description from Account Codes, where it belongs.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



chessMaster said:
I have two tables Acct Codes and Batches. Account Codes has two fields,
account and Description. The realtionship is:

[Account Codes.account] has a 1-to-many to [Batches].acct

How do I use a lookup so that when a user inputs data in [Batches].acct,
the
[Batches].description is automatically updated to reflect the value of the
related [Account Codes].description?

thanks,
 
D

Douglas J. Steele

A common approach on your form is to have a combobox that pulls all of the
Account information, and bind it to the acct field.

Take a look at the Orders form in the Northwind database that came Access.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



chessMaster said:
Thank you Doug,

I have removed the Description column from the Batches table.

How do I used this in a form so that when user enter Account Codes, the
Description field is auto updated to reflect the description of the
account
code?

Thanks!

Douglas J. Steele said:
Realistically, you shouldn't be storing the Description in the Batches
table. That's a violation of database normalization principles.

You've got acct in Batches: use that to link the two tables, and get the
description from Account Codes, where it belongs.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



chessMaster said:
I have two tables Acct Codes and Batches. Account Codes has two fields,
account and Description. The realtionship is:

[Account Codes.account] has a 1-to-many to [Batches].acct

How do I use a lookup so that when a user inputs data in
[Batches].acct,
the
[Batches].description is automatically updated to reflect the value of
the
related [Account Codes].description?

thanks,
 
G

Guest

Thanks Doug,

really helpful stuff. I give you a MVP Double GOLD STAR and a bottle of
MOLSON. :)

*** I enjoyed reading from your webpage

Thanks


chessMaster said:
Thank you Doug,

I have removed the Description column from the Batches table.

How do I used this in a form so that when user enter Account Codes, the
Description field is auto updated to reflect the description of the account
code?

Thanks!

Douglas J. Steele said:
Realistically, you shouldn't be storing the Description in the Batches
table. That's a violation of database normalization principles.

You've got acct in Batches: use that to link the two tables, and get the
description from Account Codes, where it belongs.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



chessMaster said:
I have two tables Acct Codes and Batches. Account Codes has two fields,
account and Description. The realtionship is:

[Account Codes.account] has a 1-to-many to [Batches].acct

How do I use a lookup so that when a user inputs data in [Batches].acct,
the
[Batches].description is automatically updated to reflect the value of the
related [Account Codes].description?

thanks,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top