Using Lookup in Tables

  • Thread starter Thread starter Guest
  • Start date Start date
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,
 
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.
 
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,
 
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,
 
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,
 
Back
Top