dbTalk Databases Forums  

Populating fields from a separate table

comp.databases.ms-access comp.databases.ms-access


Discuss Populating fields from a separate table in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
EJH
 
Posts: n/a

Default Populating fields from a separate table - 08-20-2005 , 12:22 AM






I have a Database that has three tables. One of the three is just a table
that contains three fields and is filled with reference information. One
field is 3-Digit(primary key), the next is Office, and the last is Area.
The next table has the same type of headings plus several other fields but
is not filled with data. I want to be able to create a form and enter a 3
digit number in the 3-Digit field of the second table and have it extract
information from the first table to fill in the Office and Area fields of
the second table. There will be more information in the second table, but I
just need to know how to populate these two fields. I have tried different
functions, including a Dlookup, but I must be putting it in the wrong place
or creating the syntax wrong. I am a newbie and appreciate any help.
Thanks.



Reply With Quote
  #2  
Old   
pietlinden@hotmail.com
 
Posts: n/a

Default Re: Populating fields from a separate table - 08-20-2005 , 02:00 AM






If the data is already in one of your tables, why copy it? Is it going
to change? If not, why not use a combobox for the 3-digit PK, set
limit-to-list to true, and then add a couple more columns to your
combobox and hide them? something like:
Column Count:=3
Column widths = 1;0;0
Rowsource= ? (Can't tell from the description of the problem)
then you have two textboxes - calculated fields.
=cboPK.Column(1)
and
=cboPK.Column(2)
Note: columns is a zero-based collection...

Hope that helps (and that maybe someone can explain it better than I!)


Reply With Quote
  #3  
Old   
Thats Me
 
Posts: n/a

Default Re: Populating fields from a separate table - 08-20-2005 , 09:08 AM



You don't need store the existing data in the second table, just store
the key from the first table and use a query to display the exiting
data when required. Remove the office and area columns from table two.

On your form to populate table two add a combo box control with;
row source type set to table/query,
row source set to table one,
bound column set to the column number of the 3-Digit(primary key),
Control source set to the field in table two that holds the
3-Digit number.
(the built-in wizzard will walk you through this)

To display the data create a query with Table two and table one as the
data source
use the 3 digit column from table two
Office and Area from table one
set the join type to a left join on the 3 digit column.

This method will allow you to add new offices, assign existing offices
to a diferent area and many other things with out having to go into
table two and "up-date" mismatched records due to the storage of
redundant data.

On Fri, 19 Aug 2005 22:22:07 -0600, "EJH" <seyahde (AT) cableone (DOT) net>
wrote:

Quote:
I have a Database that has three tables. One of the three is just a table
that contains three fields and is filled with reference information. One
field is 3-Digit(primary key), the next is Office, and the last is Area.
The next table has the same type of headings plus several other fields but
is not filled with data. I want to be able to create a form and enter a 3
digit number in the 3-Digit field of the second table and have it extract
information from the first table to fill in the Office and Area fields of
the second table. There will be more information in the second table, but I
just need to know how to populate these two fields. I have tried different
functions, including a Dlookup, but I must be putting it in the wrong place
or creating the syntax wrong. I am a newbie and appreciate any help.
Thanks.

Have a nice day. ldpoos (AT) NOPANTS (DOT) juno.com

Remove NOPANTS. To reply by direct E-Mail;
Support: The Right to Privacy and Anti-SPAM projects


Reply With Quote
  #4  
Old   
EJH
 
Posts: n/a

Default Re: Populating fields from a separate table - 08-20-2005 , 10:55 AM



Thanks to all,

I kind of came up with the duplication part while I was sleeping, but this
explains more how to do it. I will give it a try.


"Thats Me" <yqcbbf (AT) whab (DOT) pbz> wrote

Quote:
You don't need store the existing data in the second table, just store
the key from the first table and use a query to display the exiting
data when required. Remove the office and area columns from table two.

On your form to populate table two add a combo box control with;
row source type set to table/query,
row source set to table one,
bound column set to the column number of the 3-Digit(primary key),
Control source set to the field in table two that holds the
3-Digit number.
(the built-in wizzard will walk you through this)

To display the data create a query with Table two and table one as the
data source
use the 3 digit column from table two
Office and Area from table one
set the join type to a left join on the 3 digit column.

This method will allow you to add new offices, assign existing offices
to a diferent area and many other things with out having to go into
table two and "up-date" mismatched records due to the storage of
redundant data.

On Fri, 19 Aug 2005 22:22:07 -0600, "EJH" <seyahde (AT) cableone (DOT) net
wrote:

I have a Database that has three tables. One of the three is just a table
that contains three fields and is filled with reference information. One
field is 3-Digit(primary key), the next is Office, and the last is Area.
The next table has the same type of headings plus several other fields but
is not filled with data. I want to be able to create a form and enter a 3
digit number in the 3-Digit field of the second table and have it extract
information from the first table to fill in the Office and Area fields of
the second table. There will be more information in the second table, but
I
just need to know how to populate these two fields. I have tried
different
functions, including a Dlookup, but I must be putting it in the wrong
place
or creating the syntax wrong. I am a newbie and appreciate any help.
Thanks.


Have a nice day. ldpoos (AT) NOPANTS (DOT) juno.com

Remove NOPANTS. To reply by direct E-Mail;
Support: The Right to Privacy and Anti-SPAM projects



Reply With Quote
Reply




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 On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.