473,395 Members | 1,537 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,395 software developers and data experts.

Relationships, Lookups and Access 2007 tables

Hello All,

I don't have a problem (but maybe I will after I explain). I have a
question with regards to something I saw in Access 2007. But first, a
little backstory:

I'm writing a very small stock database. For now, it will simply track
what products come in (Stocks bought by Project) and what products go
out (Stocks sold to by Project) . There are three tables: Products,
Transactions and Projects.

I've used the lookup wizard to 'create' three fields in the
Transaction table: ProjectST, ProjectBF (Project Sold To, Project
Bought For) and Products.

When a user enters an 'IN' transaction (directly via the Transaction
table), they enter, among other things, the date of the transaction,
and the Product which is chosen via the lookup to the Products table.
While this displays the full Product detail, it only stores the ProdID
(which is the PK of the Products table) value in the 'Products' field
of the Transaction table .

(Note: after this design, I looked at the Relationships Manager and
saw a 1:N relation between the Products table and the Transaction
table, i.e., one product can be used in many transactions, or, there
can be many transactions, but each can only have one product).

Besides the date of the trans and the product concerned, users can
also enter, depending on the type of transaction, a ProjectBF and
ProjectST. In the above example, an IN, the user would choose via the
same sort of lookup, a project from the Projects table. This would be
stored in the ProjectBF field (created in the Transaction table via
the aforementioned lookupcolumn). The ProjectST field would remain
empty.

However, in an OUT transaction, the user would choose the project from
ProjectBF first, and then choose the project that it was sold to via a
lookup (again to the projects table, in other words, two lookups to
the Projects table), this would be stored in the ProjectST field of
the Transaction table.

This is necessary because there are cases when stock bought for
Project A is sent to Project B, but a transaction of stock out must
record that it was bought for A and sold to B.

So I looked at the Relationship window again and saw the two (both of
them 1:N) relations from Transactions to the Projects table and now a
new 'table' called Projects_1. ProjBF in the Transaction table goes to
ProjCode (PK) in Projects and ProjST in Transaction goes to ProjCode
(PK) in something new called Projects_1 (which I gather is what Access
created automatically).

Is this normal, i.e., for a second 'table' or 'ghost table' (LOL) to
be created?

Or should I have just created an identical table, i.e., ProjectsBF and
ProjectsST and used lookups in the Transaction table to each
respective Projects table?

Any thoughts/comments?

Rgds,
NN.

P.S, I know there will be some 'fun and games' if and when referential
integrity comes into play, i.e., if someone deletes a project and
integrity and cascading are enabled.
Sep 25 '08 #1
4 4357
On Sep 25, 9:38*am, netnewbi...@gmail.com wrote:
Hello All,

I don't have a problem (but maybe I will after I explain). I have a
question with regards to something I saw in Access 2007. But first, a
little backstory:

I'm writing a very small stock database. For now, it will simply track
what products come in (Stocks bought by Project) and what products go
out (Stocks sold to by Project) . There are three tables: Products,
Transactions and Projects.

I've used the lookup wizard to 'create' three fields in the
Transaction table: ProjectST, ProjectBF (Project Sold To, Project
Bought For) and Products.

When a user enters an 'IN' transaction (directly via the Transaction
table), they enter, among other things, the date of the transaction,
and the Product which is chosen via the lookup to the Products table.
While this displays the full Product detail, it only stores the ProdID
(which is the PK of the Products table) value in the 'Products' field
of the Transaction table .

(Note: after this design, I looked at the Relationships Manager and
saw a 1:N relation between the Products table and the Transaction
table, i.e., one product can be used in many transactions, or, there
can be many transactions, but each can only have one product).

Besides the date of the trans and the product concerned, users can
also enter, depending on the type of transaction, a ProjectBF and
ProjectST. In the above example, an IN, the user would choose via the
same sort of lookup, a project from the Projects table. This would be
stored in the ProjectBF field (created in the Transaction table via
the aforementioned lookupcolumn). The ProjectST field would remain
empty.

However, in an OUT transaction, the user would choose the project from
ProjectBF first, and then choose the project that it was sold to via a
lookup (again to the projects table, in other words, two lookups to
the Projects table), this would be stored in the ProjectST field of
the Transaction table.

This is necessary because there are cases when stock bought for
Project A is sent to Project B, but a transaction of stock out must
record that it was bought for A and sold to B.

So I looked at the Relationship window again and saw the two (both of
them 1:N) relations from Transactions to the Projects table and now a
new 'table' called Projects_1. ProjBF in the Transaction table goes to
ProjCode (PK) in Projects and ProjST in Transaction goes to ProjCode
(PK) in something new called Projects_1 (which I gather is what Access
created automatically).

Is this normal, i.e., for a second 'table' or 'ghost table' (LOL) to
be created?

Or should I have just created an identical table, i.e., ProjectsBF and
ProjectsST and used lookups in the Transaction table to each
respective Projects table?

Any thoughts/comments?

Rgds,
NN.

P.S, I know there will be some 'fun and games' if and when referential
integrity comes into play, i.e., if someone deletes a project and
integrity and cascading are enabled.
It's unlikely that there is a new table. Projects_1 is likely to be an
Alias for Projects; the Alias identifies which instance of the table
is being referenced.

You might want to glance at
www.mvps.org/access/tencommandments.htm
before you continue with "Lookup" tables.
Sep 25 '08 #2
On Sep 25, 10:42*am, lyle fairfield <lyle.fairfi...@gmail.comwrote:
On Sep 25, 9:38*am, netnewbi...@gmail.com wrote:


Hello All,
I don't have a problem (but maybe I will after I explain). I have a
question with regards to something I saw in Access 2007. But first, a
little backstory:
I'm writing a very small stock database. For now, it will simply track
what products come in (Stocks bought by Project) and what products go
out (Stocks sold to by Project) . There are three tables: Products,
Transactions and Projects.
I've used the lookup wizard to 'create' three fields in the
Transaction table: ProjectST, ProjectBF (Project Sold To, Project
Bought For) and Products.
When a user enters an 'IN' transaction (directly via the Transaction
table), they enter, among other things, the date of the transaction,
and the Product which is chosen via the lookup to the Products table.
While this displays the full Product detail, it only stores the ProdID
(which is the PK of the Products table) value in the 'Products' field
of the Transaction table .
(Note: after this design, I looked at the Relationships Manager and
saw a 1:N relation between the Products table and the Transaction
table, i.e., one product can be used in many transactions, or, there
can be many transactions, but each can only have one product).
Besides the date of the trans and the product concerned, users can
also enter, depending on the type of transaction, a ProjectBF and
ProjectST. In the above example, an IN, the user would choose via the
same sort of lookup, a project from the Projects table. This would be
stored in the ProjectBF field (created in the Transaction table via
the aforementioned lookupcolumn). The ProjectST field would remain
empty.
However, in an OUT transaction, the user would choose the project from
ProjectBF first, and then choose the project that it was sold to via a
lookup (again to the projects table, in other words, two lookups to
the Projects table), this would be stored in the ProjectST field of
the Transaction table.
This is necessary because there are cases when stock bought for
Project A is sent to Project B, but a transaction of stock out must
record that it was bought for A and sold to B.
So I looked at the Relationship window again and saw the two (both of
them 1:N) relations from Transactions to the Projects table and now a
new 'table' called Projects_1. ProjBF in the Transaction table goes to
ProjCode (PK) in Projects and ProjST in Transaction goes to ProjCode
(PK) in something new called Projects_1 (which I gather is what Access
created automatically).
Is this normal, i.e., for a second 'table' or 'ghost table' (LOL) to
be created?
Or should I have just created an identical table, i.e., ProjectsBF and
ProjectsST and used lookups in the Transaction table to each
respective Projects table?
Any thoughts/comments?
Rgds,
NN.
P.S, I know there will be some 'fun and games' if and when referential
integrity comes into play, i.e., if someone deletes a project and
integrity and cascading are enabled.

It's unlikely that there is a new table. Projects_1 is likely to be an
Alias for Projects; the Alias identifies which instance of the table
is being referenced.

You might want to glance atwww.mvps.org/access/tencommandments.htm
before you continue with "Lookup" tables.- Hide quoted text -

- Show quoted text -
Hi,

Thanks for your reply/explanation, I was a bit puzzled. Re: the 10
commandments/lookup bit, I've read about them before. However, based
on my scenario above, do you (or anyone else out there), have any
suggestions/recommendations to get around it?

Rgds,
NN.
Sep 25 '08 #3
Hi,
>
Thanks for your reply/explanation, I was a bit puzzled. Re: the 10
commandments/lookup bit, I've read about them before. However, based
on my scenario above, do you (or anyone else out there), have any
suggestions/recommendations to get around it?
Of course we "normalize". We use candidate tables. We establish
relationships. We enforce referential integrity. But these things are
extraneous to the intrinsic organization of any table. We use our
relationships in forms and subforms and reports. We are in control. MS-
Access does not do what it "thinks" should be done. It does what we
tell it to do.
Sep 25 '08 #4
On Sep 25, 1:55*pm, lyle fairfield <lyle.fairfi...@gmail.comwrote:
Hi,
Thanks for your reply/explanation, I was a bit puzzled. Re: the 10
commandments/lookup bit, I've read about them before. However, based
on my scenario above, do you (or anyone else out there), have any
suggestions/recommendations to get around it?

Of course we "normalize". We use candidate tables. We establish
relationships. We enforce referential integrity. But these things are
extraneous to the intrinsic organization of any table. We use our
relationships in forms and subforms and reports. We are in control. MS-
Access does not do what it "thinks" should be done. It does what we
tell it to do.
Hi again,

1. What is meant by candidate tables and what do you mean when you say
you use the relationships in forms? Relatations are created between
tables, no? Tables are at the 'lowest level' so to speak, i.e., forms
'sit on top' of tables (of course the hierarchy is files, records,
fields, or something like that if I recall correctly).

2. Are you saying that I can have a form for my transaction table
(whichi is displayed in datasheet view as it is quicker to tab across
for data entry purposes), which has a control (a lookup/combo) to my
Products table which will let the user choose a product? (without the
use of lookup columns/fields which the 10 commandments warn against).
Is this not the same, forgive me, then as using the Lookup Wiz and
letting access create a field in the Transaction table which looks up
the Product table directly (minus the need for the form for the
Transaction table)?

Or have I missed the boat all together?

Thanks,
NN.
Sep 25 '08 #5

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

Similar topics

49
by: Mal | last post by:
Hi, As I gain knowledge through a lot of trial, error, and usenet posts.. I have a potentially odd question. I am using a commercial access application. It is a front-end / back...
2
by: Max | last post by:
Hi. I really hope someone can help me. Going slowly insane with this problem. I have a two Access 2000 databases. One is the backend containing tables and some admin queries. The other is the...
7
by: davegb | last post by:
I'm totally new to relational database design. My boss has asked me to create a database of information on the employees in our group. Seemed to me like a simple application to learn the ropes. A...
45
by: salad | last post by:
I'm curious about your opinion on setting relationships. When I designed my first app in Access I'd go to Tools/Relationships and set the relationships. Over time I'd go into the window and see...
2
blyxx86
by: blyxx86 | last post by:
I've been creating some lookup values to tables, but for whatever reason it is not creating that 'phantom_1' table like it sometimes did. So now it is creating a relationship to the original table...
1
by: Ron | last post by:
Hi All, I have relationships on a database built in the back end, but I'm wondering if that's where they should be. Can they be built in the front end but apply to all the back end tables? Can...
6
by: Tazzy via AccessMonster.com | last post by:
Hi all, I'm in the process of setting up a database for a project that involves actors, shows and venues and have set up tables as follows; TblActors - Stage name(Primary key), real name, etc....
13
by: ARC | last post by:
Hello all, Prior to going live with my app, I have questions on relationships theory. My prior app was done in Access 97, and I did NOT use relationships at all. I have 65 tables in my...
8
by: Phil Stanton | last post by:
I have a FE, BE database on my home computer and a duplicate on the office computer. Both use Ak2 on Windows XP. The one at home appears normal. The BE consists of about 50 tables with numerous...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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,...
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...
0
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...

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.