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 » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Auto enter data into 2 fields



 
 
Thread Tools Display Modes
  #1  
Old May 8th, 2007, 10:21 PM posted to microsoft.public.access.tablesdbdesign
C. Sharp
external usenet poster
 
Posts: 29
Default Auto enter data into 2 fields

I have 2 tables: TBL_Corporate and TBL_Client. We enter the corporate name,
etc.. in the first table but in the second table if we enter the CORP ID it
will link those 2 tables. Is there a way if I enter CORP ID as 77 that it
will auto enter the Corporate name from the first table into the second table?
  #2  
Old May 8th, 2007, 10:45 PM posted to microsoft.public.access.tablesdbdesign
Carl Rapson
external usenet poster
 
Posts: 517
Default Auto enter data into 2 fields

Not if you're entering information directly into the tables, because tables
don't have events you can trap. You'd need to enter your data through a
form, where you could trap the AfterUpdate event on the control bound to the
CORP ID field and write VBA code to insert the Corporate name.

That said, you can do it that way, but you shouldn't. If you have the CORP
ID in the TBL_Client, why do you need to store the Corporate name there
also? Just do a lookup on the CORP ID from TBL_Corporate any time you need
the name.

Carl Rapson

"C. Sharp" wrote in message
...
I have 2 tables: TBL_Corporate and TBL_Client. We enter the corporate
name,
etc.. in the first table but in the second table if we enter the CORP ID
it
will link those 2 tables. Is there a way if I enter CORP ID as 77 that it
will auto enter the Corporate name from the first table into the second
table?



  #3  
Old May 9th, 2007, 12:01 AM posted to microsoft.public.access.tablesdbdesign
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Auto enter data into 2 fields

On Tue, 8 May 2007 14:21:01 -0700, C. Sharp
wrote:

I have 2 tables: TBL_Corporate and TBL_Client. We enter the corporate name,
etc.. in the first table but in the second table if we enter the CORP ID it
will link those 2 tables. Is there a way if I enter CORP ID as 77 that it
will auto enter the Corporate name from the first table into the second table?


You shouldn't.

Relational databases use the "Grandmother's Pantry Principle" - "a place - ONE
place! - for everything, everything in its place". Store the Corp_ID in the
Client table; if you need to see the corporation name in conjunction with
client data, use a Combo Box storing the ID but displaying the name, or use a
Query joining the two tables.

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


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


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