473,614 Members | 2,352 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Given up - need some assistance

I know a little about Access and have made several single table
databases. Been struggling for about a month to do a multiple table
database with no success. Help!

There are two tables. First has about 30 fields. Every entry in this
table will be unique. Second table has about 7 fields and is for
reference - strictly a look up type table. I want to use one field,
say FAMILY in the first table to look up any one of the 400 items in
the second table. Based on that one match, I want the form to
automatically show the other 6 fields that coincide with that record
in the second table. Does that make sense?

This is all in one form. I want to be able to type in the letters in
field FAMILY and have it seek the appropriate match. Based on that
match, I want the other 6 fields to show up (be visible) but not be
editable. I have no problem getting the form to use the second table
to look up the FAMILY field, but cannot for the life of me figure out
how to display the rest of the data associated with that record in the
second table.

Can someone help guide me to get this to work? I've tried using combo
boxes, subforms, adding shared fields to each table, played with
relationships, and nothing works. I managed to get a subform showing
all the table two data in the form, but I couldn't get it to relate to
the field in the first table.

To simplfy, say I have two tables. One and Two. First table has five
fields, A,B,C,D,E. Second table has some fields, A,D,M,N,O. These are
all text fields except "A". A would be the autonumber primary field of
each table which has nothing in common. The common field is "D". I
want a combo box in the single form database to look up the value of
"D" in the second table. Based on the chosen value for that record, I
want text fields to show the corresponding values of M, N, and O. How
can this be done?

Thanks.

Jun 20 '07 #1
7 2025
A table with 30 fields throws up a bright red flag. 99.99% chance it is
incorrectly designed. I recommend you post your table for the people here to
look at and make suggestions. You need to make sure you are starting out on
the right foot with your database.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
re******@pcdata sheet.com


"Rnykster" <Rn******@yahoo .comwrote in message
news:11******** **************@ k79g2000hse.goo glegroups.com.. .
>I know a little about Access and have made several single table
databases. Been struggling for about a month to do a multiple table
database with no success. Help!

There are two tables. First has about 30 fields. Every entry in this
table will be unique. Second table has about 7 fields and is for
reference - strictly a look up type table. I want to use one field,
say FAMILY in the first table to look up any one of the 400 items in
the second table. Based on that one match, I want the form to
automatically show the other 6 fields that coincide with that record
in the second table. Does that make sense?

This is all in one form. I want to be able to type in the letters in
field FAMILY and have it seek the appropriate match. Based on that
match, I want the other 6 fields to show up (be visible) but not be
editable. I have no problem getting the form to use the second table
to look up the FAMILY field, but cannot for the life of me figure out
how to display the rest of the data associated with that record in the
second table.

Can someone help guide me to get this to work? I've tried using combo
boxes, subforms, adding shared fields to each table, played with
relationships, and nothing works. I managed to get a subform showing
all the table two data in the form, but I couldn't get it to relate to
the field in the first table.

To simplfy, say I have two tables. One and Two. First table has five
fields, A,B,C,D,E. Second table has some fields, A,D,M,N,O. These are
all text fields except "A". A would be the autonumber primary field of
each table which has nothing in common. The common field is "D". I
want a combo box in the single form database to look up the value of
"D" in the second table. Based on the chosen value for that record, I
want text fields to show the corresponding values of M, N, and O. How
can this be done?

Thanks.

Jun 21 '07 #2
On Wed, 20 Jun 2007 16:41:21 -0700, Rnykster <Rn******@yahoo .com>
wrote:

This smells like bad database design. The more typical scenario is
called one-to-many where one record in tblOne has many records in
tblTwo, linked by tblOne.PrimaryK ey = tblTwo.ForeignK ey.

If you don't get the db design right, the rest of your app will suffer
tremendously. Why not hire an expert for a few hours or days to get
the foundation right, then you can take it from there. "Microsoft
Solution Provider" in your Yellow Pages may be a place to start.

-Tom.

<clip>
>To simplfy, say I have two tables. One and Two. First table has five
fields, A,B,C,D,E. Second table has some fields, A,D,M,N,O. These are
all text fields except "A". A would be the autonumber primary field of
each table which has nothing in common. The common field is "D". I
want a combo box in the single form database to look up the value of
"D" in the second table. Based on the chosen value for that record, I
want text fields to show the corresponding values of M, N, and O. How
can this be done?

Thanks.
Jun 21 '07 #3
There are two tables. First has about 30 fields. Every entry in this
table will be unique. Second table has about 7 fields and is for
reference - strictly a look up type table. I want to use one field,
say FAMILY in the first table to look up any one of the 400 items in
the second table. Based on that one match, I want the form to
automatically show the other 6 fields that coincide with that record
in the second table. Does that make sense?

This is all in one form. I want to be able to type in the letters in
field FAMILY and have it seek the appropriate match. Based on that
match, I want the other 6 fields to show up (be visible) but not be
editable. I have no problem getting the form to use the second table
to look up the FAMILY field, but cannot for the life of me figure out
how to display the rest of the data associated with that record in the
second table.

Can someone help guide me to get this to work? I've tried using combo
boxes, subforms, adding shared fields to each table, played with
relationships, and nothing works. I managed to get a subform showing
all the table two data in the form, but I couldn't get it to relate to
the field in the first table.

To simplfy, say I have two tables. One and Two. First table has five
fields, A,B,C,D,E. Second table has some fields, A,D,M,N,O. These are
all text fields except "A". A would be the autonumber primary field of
each table which has nothing in common. The common field is "D". I
want a combo box in the single form database to look up the value of
"D" in the second table. Based on the chosen value for that record, I
want text fields to show the corresponding values of M, N, and O. How
can this be done?
OK, your mistake here is that you're using a non-primary key field in both
table to relate the two tables. You need to use the primary key field in the
second table (lookup table) to relate to a non-primary key field in the
first table. That non-primary key field in the first table that relates to
the primary key field in the second table is called a "foreign key field" in
the first table.

So, using your above field, field "D" in the first table ("Table1") would
relate to field "A" in the second table ("Table2"). Keep field "A" in the
second table as an autonumber primary key field in that table. But change
field "D" in the first table to be a Number of type Long Integer. Make sure
it has no default value (instead of the "0" that Access puts there by
default).

Now place both tables in your form's underlying query, joining them on
Table1.D = Table2.A. Make sure to make it an outer join from Table1 to
Table2. That way, if Table1 has a Null value in field "D" (user hasn't
entered a value yet), you'll still be able to display records from Table1

Now add the fields from Table1 that you want to use (including field D) to
your query, as well as the six other fields from Table2 you want to use (but
don't add the primary key field, A, since that will be the same as the one
the users are using for lookup).

After all those fields are in your underlying query, simply add them to your
form. Make the controls based on the 6 fields from the second table
read-only by setting their Locked property to True or their Enabled property
to False.

In the combo box based on Table1, field D, use Table2 as its RowSource,
making sure that field A from Table2 corresponds to the bound column of the
combo box. You can make the combo box be as many columns as you'd like, as
long as Field A corresponds to the bound column.

Now use your form. When the user selects a value for field D from the combo
box, the corresponding values from Table2 will "kick in" and the data in the
6 fields will be displayed.

Neil
>
Thanks.

Jun 21 '07 #4
Now use your form. When the user selects a value for field D from the combo
box, the corresponding values from Table2 will "kick in" and the data in the
6 fields will be displayed.

Neil

Thanks for the reply Neil. I made the changes you recommended. My main
form is not based on any query. Did make a query and tied the two
tables together. Everything looked good in the query. Got the main
field "D" working in the form using a combo box. Still can't get the
remaining table 2 fields to display though. Even tried creating a
brand new from based on the query. Can't get it working there either.
I ask a local company they or anyone else is available for hire so I
can sit down with them to fix the problem. No reply. I'll try
tinkering with more options. There has to be a way to have Access to
do a simple if this equals that, display this routine. Then again, I
remember creating a database a few years ago in Access (No, I'm not
brand new to Access), and wanting a field to keep track of the date of
the latest change of each record. In Lotus, it was easily accomplished
with available options - a quick drop and drag. I had to do much
research - a month wasted and eventually detailed help came from the
newsgroup. I had to do lenghty visual basic coding to make it work. I
keep thinking a two table database with lookups for the second table
should be easy...
Jun 22 '07 #5

"Rnykster" <Rn******@yahoo .comwrote in message
news:11******** **************@ x35g2000prf.goo glegroups.com.. .
>Now use your form. When the user selects a value for field D from the
combo
box, the corresponding values from Table2 will "kick in" and the data in
the
6 fields will be displayed.

Neil


Thanks for the reply Neil. I made the changes you recommended. My main
form is not based on any query. Did make a query and tied the two
tables together.
Well, whether you use a saved query or you create an ad-doc query through
the form's Recordsource property, your form is still based on a query.
Everything looked good in the query. Got the main
field "D" working in the form using a combo box. Still can't get the
remaining table 2 fields to display though. Even tried creating a
brand new from based on the query. Can't get it working there either.
Well, you need to make sure you followed all the steps I gave you. Are your
primary keys set up correctly? Is the bound column in the combo box the same
as the primary key for Table2? Did you follow all the other steps exactly?
If you follow all the steps exactly, it should work. So you need to go back
over the note I sent and double check that everything is done as I wrote
you.

Also, you can go into the underlying query (through the form's Recordsource
property), and then open the query in Datasheet view. From there, either
create a new record for Table1 (which you can later delete), or go to an
existing record for Table1 which has no value for Field D. Enter a value for
Field D and move to the next field. Do the corresponding records from Table2
appear? If not, then there's something wrong with your underlying tables or
query; if they do, then there's something wrong with your form or combo box.

If I had to guess, I'd say that you're not using the primary key value for
Table2 in Field D of Table 1. But that would just be a guess. Could be
something else as well. You need to make sure that you follow all steps
exactly and double-check your work.

Neil
Jun 23 '07 #6
If I had to guess, I'd say that you're not using the primary key value for
Table2 in Field D of Table 1. But that would just be a guess. Could be
something else as well. You need to make sure that you follow all steps
exactly and double-check your work.
Neil
Success! I had everything set up right. Trouble was I kept trying
to use combo boxes or text boxes and changing the properties of table
fields to fix the problem. The fields I expected to see data in, had
Name# in them. The trouble was in the form properties. It wasn't
using the right source. Once I based the form source on the query of
both tables, everything worked just fine. Thanks for your help Neil.
Jun 25 '07 #7
Sure, no problem. Glad it worked out for you.

Neil

"Rnykster" <Rn******@yahoo .comwrote in message
news:11******** *************@q 69g2000hsb.goog legroups.com...
>If I had to guess, I'd say that you're not using the primary key value
for
Table2 in Field D of Table 1. But that would just be a guess. Could be
something else as well. You need to make sure that you follow all steps
exactly and double-check your work.
Neil

Success! I had everything set up right. Trouble was I kept trying
to use combo boxes or text boxes and changing the properties of table
fields to fix the problem. The fields I expected to see data in, had
Name# in them. The trouble was in the form properties. It wasn't
using the right source. Once I based the form source on the query of
both tables, everything worked just fine. Thanks for your help Neil.


Jun 25 '07 #8

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

Similar topics

0
1777
by: Jawahar | last post by:
All I had posted this in the remote assistance group and could not get any replies so I thought that I could try in the developer group Thanks One of the issues we face when helping our remote workers is that they are (9 out of 10 times) behind a router. So when they initiate a Remote assistance call they always do so via email and then our Help desk folk manually alter the file using notepad withe correct IP address and also default...
2
1984
by: CSDunn | last post by:
Hello, I need some assistance with error handling in an Access 2003 Project form. The project is has a data source connection to a SQL Server 2000 database. The main form is named ‘frmSelectByTest', and its subform's ‘Name' and ‘Source Object' properties are ‘frmSelectByTestSub'. The ‘Default View' on the main form is ‘Single Form', and on the sub form is ‘Continuous Forms'. The users select the name of a test (uniquely identified by a...
0
1603
by: Joe Ross | last post by:
(Apologies in advance if there is a better forum for asking advice on this topic). Our ASP.NET application occasionally starts spitting out OutOfMemory exceptions. When this happens, the memory usage for that IIS worker process is over 1GB. I understand in this sceneario that the virtual memory pool can become fragmented and produce this type of exception. This time, however, I was able to do an ADPlus dump while it was in this...
0
1328
by: mwalk66 | last post by:
I have been able to create a web based company phone book by retrieving the last name, first name, email address and telephone # from active directory. However I need serious assistance in modifying the code to sort the columns by order of last name then first name for ease of use by our user community. Any assistance woudl be much appreciate since I am a complete newbie to asp. I have quoted the cide for producing the address book as...
46
2508
by: Bruce W. Darby | last post by:
This will be my very first VB.Net application and it's pretty simple. But I've got a snag in my syntax somewhere. Was hoping that someone could point me in the right direction. The history: My work involves creating custom packages of our software product for golf courses that purchase our software. The course data is kept as a back up in the event the course needs us to replace their custom files. Each course has a folder of it's own...
15
16058
by: Dave | last post by:
I am getting the error above intermittantly with an ASP 3.0 page using an MS Access 2003 database. I have searched Google extensively and found the following possible causes for this error: A field name was spelled incorrectly. One or more of the values was blank. You tried to insert the wrong datatype (e.g. surrounded a numeric value with quotes, or forgot to put quotes around a string).
0
4591
by: AxleWacl | last post by:
Hi, The below error is what I am receiving. The code im using is below the error, for the life of me, I can not see where any parameter is missing..... Server Error in '/FleetcubeNews' Application. -------------------------------------------------------------------------------- No value given for one or more required parameters. Description: An unhandled exception occurred during the execution of the current web request. Please...
1
4855
by: DR | last post by:
What ports do i need to unblock on client and server (running msvsmon.exe) to debug remotely from my client box with visual studio 2005 pro? When I attach to remote process a connection shows up in msvsmon.exe on the remote machine, however, the client box with visual studio displays error: "Unable to connect to the mricosoft visual studio remtoe debugging monitor named 'the box name' the micorosft visual studio remote debugging monitor...
3
2252
by: gaurav92K | last post by:
sir i am working in a company . there are many pc. i want to use remote assistance. i configure all group policy which are related remote assistance.and i enable service through remote in system property.every services related remote desktop & remote assistance are start . but i can not use help assistance through another system while i try help assistance in my pc then help assistance begin start. what is problem please give the best answer on...
0
8198
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8142
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8642
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8444
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7115
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6093
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5549
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2575
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1438
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.