473,387 Members | 1,573 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Populating fields from a separate table

EJH
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.
Nov 13 '05 #1
3 3030
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!)

Nov 13 '05 #2
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" <se*****@cableone.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. ld****@NOPANTS.juno.com

Remove NOPANTS. To reply by direct E-Mail;
Support: The Right to Privacy and Anti-SPAM projects
Nov 13 '05 #3
EJH
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" <yq****@whab.pbz> wrote in message
news:ou********************************@4ax.com...
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" <se*****@cableone.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. ld****@NOPANTS.juno.com

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

Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Drew | last post by:
I have a db table like the following, UID, int auto-increment RegNo Person Relation YearsKnown Now here is some sample data from this table,
1
by: cloverme | last post by:
Hi, I need help populating a listbox from a database on a webform. I created a an access database with a table, fields and data. Then I created a WebForm in vb.net and added a DropDownList...
5
by: Megan | last post by:
Hi everybody- I'm helping a friend with a music database. She has an old one and is creating a new one. She wants to compare records and fields in the old database with records and fields in the...
5
by: ND | last post by:
I need to create a separate field from 4 fields, "street address", "city", "State" and "zip code". For example, Street address - 100 Forest Street City - Seattle State - WA Zip - 05555 ...
13
by: Mary | last post by:
I'll pulling my hair out on this one and would be so appreciative of any help. I am creating a data entry form to enter results of a student survey. There are 40 questions on the survey. The...
27
by: wideasleep | last post by:
Hello, I have a form that has a combo box that populates other fields. This works great but it doesn't save that information in the table where those fields are coming from. The only one that's...
4
by: prosad | last post by:
hello, Just solved a problem using Javascript onclick, can click on any cell in a dynamic table and it will pass the innerText object value to my form text field. parts of code given below: ...
10
by: ARC | last post by:
This is mainly a speed question. In this example: I have a QuotesHdr table that has a few memo fields. If these memo fields are used extensively by some users, and if their are a large number of...
0
by: daverskully | last post by:
I have two tables created and want to link two forms created from these tables so that specific fields are populated once one field is selected, but not all fields being populated, with a new record...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.