473,406 Members | 2,894 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,406 software developers and data experts.

Is there a benefit of setting up relationships in A2003?

Hi,

I have been manually setting up relationships in Access 2003. I
received an error message when leaving a form that told me the record
could not be saved because I had to have a related record in another (
child) table.

After researching the problem, I decided to open up the table
relationship manager and selected the "Show All" option.

I believe Access automatically sets up relationships when needed
(doesn't "Show All' display relationships not set up by the
developer?). I went through each relationship and found that Access
incorrectly set up a relationship between two fields from two tables
that have different field names (one of them was not even a primary
key field!).

So why should I bother manually setting up relationships?

Thanks
-pw

use paulwilliamson at spamcop dot net for e-mail
Nov 13 '05 #1
3 1768
Umm... how about control? And enforcing correct referential integrity.
So you can't have childless parents. (You have your terminology
backwards.)

Kinda important that you can't have a bank transaction without having
an account... of course, you *can* do the cascading update/delete stuff
in code, but it's a lot more work... and you can do the fun stuff that
Oracle lets you do, like doing SET NULL...

how you handle enforcement of referential integrity is up to you - you
can use code or let Access handle it... depends what you need...

Nov 13 '05 #2
The only way to construct a reliable database is to set up the relations
yourself.

There are typically lots of hidden indexes in an Access database. If you
suspect you also have hidden relations, you can list them programmatically
like this:

Function ShowRel()
Dim db As DAO.Database
Dim rel As DAO.Relation
Dim fld As DAO.Field

Set db = CurrentDb()
For Each rel In db.Relations
Debug.Print rel.Name, rel.Table, rel.ForeignTable, rel.Attributes
For Each fld In rel.Fields
Debug.Print , fld.Name, fld.ForeignName
Next
Next

Set fld = Nothing
Set rel = Nothing
Set db = Nothing
End Function

Stay away from the Lookup Wizard in table design. It's likely to do all
sorts of stuff behind your back. More info in this article:
The Evils of Lookup Fields in Tables
at:
http://www.mvps.org/access/lookupfields.htm

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

<pa******************@removespamcop.net> wrote in message
news:08********************************@4ax.com...

I have been manually setting up relationships in Access 2003. I
received an error message when leaving a form that told me the record
could not be saved because I had to have a related record in another (
child) table.

After researching the problem, I decided to open up the table
relationship manager and selected the "Show All" option.

I believe Access automatically sets up relationships when needed
(doesn't "Show All' display relationships not set up by the
developer?). I went through each relationship and found that Access
incorrectly set up a relationship between two fields from two tables
that have different field names (one of them was not even a primary
key field!).

So why should I bother manually setting up relationships?

Thanks
-pw

use paulwilliamson at spamcop dot net for e-mail

Nov 13 '05 #3
On Thu, 7 Jul 2005 13:51:59 +0800, "Allen Browne"
<Al*********@SeeSig.Invalid> wrote:
The only way to construct a reliable database is to set up the relations
yourself.

There are typically lots of hidden indexes in an Access database. If you
suspect you also have hidden relations, you can list them programmatically
like this:

Function ShowRel()
Dim db As DAO.Database
Dim rel As DAO.Relation
Dim fld As DAO.Field

Set db = CurrentDb()
For Each rel In db.Relations
Debug.Print rel.Name, rel.Table, rel.ForeignTable, rel.Attributes
For Each fld In rel.Fields
Debug.Print , fld.Name, fld.ForeignName
Next
Next

Set fld = Nothing
Set rel = Nothing
Set db = Nothing
End Function

Stay away from the Lookup Wizard in table design. It's likely to do all
sorts of stuff behind your back. More info in this article:
The Evils of Lookup Fields in Tables
at:
http://www.mvps.org/access/lookupfields.htm


Thanks Allen.
-pw

use paulwilliamson at spamcop dot net for e-mail
Nov 13 '05 #4

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

Similar topics

4
by: -Michelle- | last post by:
Hi I am using A2003 on XP. The client has A2000. So I have ensured that I have developed based on A2000 and compiled as such. I have found that in a number of cases now, I have used (what I...
1
by: Outsider | last post by:
Is anyone else having trouble setting a new COLOR_APPWORKSPACE in Access 2003. I can set all the other colors except this one. I am also using WindowsXP 2003 Professional. Can this be an issue? ...
12
by: dixie | last post by:
Can someone familiar with Access 2003 please answer this question? I am asking because I don't have the use of A2003. When Access 2003 finds an Access 2000 database, does it come up with some...
1
by: Paul Brady | last post by:
I have A97 and A2K on my computer at home, on which I do volunteer work for several databases on our county park system. One of the clients uses A97, and the rest, A2K. The A97 user is...
17
by: rdemyan via AccessMonster.com | last post by:
With A2003, I'm having trouble accessing files in a folder on another computer where back-end files, update files, etc are located. Here's the scenario: 1) Computer #1 - A2003 2) Computer #2 -...
7
by: Salad | last post by:
I am converting an application from A97 to A2003. I have 2 tables created by another application as a Foxpro.dbf. The table has no index. The connect string in A97 is FoxPro...
1
by: Fred Zuckerman | last post by:
I have a database on a shared drive. It has user level security (ie: mdw file). It was created in A2000 and works fine when opened on workstations with A2000 installed. Some workstations have...
4
by: Salad | last post by:
I have A2003 split; FE on the C drive, BE on the network. There are some other people in the system. The FE app is in A2003, the backend in A97. I have an opening form; MainMenu that opens. ...
2
by: Wayne | last post by:
I'm trying to overcome the problem that some users including myself have noticed with combo boxes in A2003 databases that are run in A2007. When the combo is tabbed out of the backstyle changes to...
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
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,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...
0
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...

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.