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

How to check related foreign keys

Hello,

This is my first post, i couldn't find an answer to my problem over
the other posts.

first - I have a Main table called [tblFile], this table has a primary
key that is an autonumber.
second - I have a LOT of tables that uses tblFile.ID as a foreign key.

thrid : I'm trying to see if i can do a query or a function (in VBA)
that could let me know Which other tables uses tblFile.ID in at least
1 row.
problem : there's too much related table to hardcode this function

example : the table tblProperies uses tblFile.ID as a foreign key and
the table tblProgram Also uses it as a foreign key. Actually there's
3 rows in property that uses a specified ID from tblFile and no rows
from tblProgram uses it.

So actually I want my query/function to return : "tblProperties" only.

Actually i don't know anything about this concern so please somebody
give me a hand!
Nov 12 '05 #1
2 1774
Can I ask what scenario would require this? Creating relationships between
all the tables would handle
most of the reasons I can think of.

Mike Storr
www.veraccess.com
"StaZ" <St*****@hotmail.com> wrote in message
news:d8************************@posting.google.com ...
Hello,

This is my first post, i couldn't find an answer to my problem over
the other posts.

first - I have a Main table called [tblFile], this table has a primary
key that is an autonumber.
second - I have a LOT of tables that uses tblFile.ID as a foreign key.

thrid : I'm trying to see if i can do a query or a function (in VBA)
that could let me know Which other tables uses tblFile.ID in at least
1 row.
problem : there's too much related table to hardcode this function

example : the table tblProperies uses tblFile.ID as a foreign key and
the table tblProgram Also uses it as a foreign key. Actually there's
3 rows in property that uses a specified ID from tblFile and no rows
from tblProgram uses it.

So actually I want my query/function to return : "tblProperties" only.

Actually i don't know anything about this concern so please somebody
give me a hand!

Nov 12 '05 #2
StaZ wrote:
Hello,

This is my first post, i couldn't find an answer to my problem over
the other posts.

first - I have a Main table called [tblFile], this table has a primary
key that is an autonumber.
second - I have a LOT of tables that uses tblFile.ID as a foreign key.

thrid : I'm trying to see if i can do a query or a function (in VBA)
that could let me know Which other tables uses tblFile.ID in at least
1 row.
problem : there's too much related table to hardcode this function

example : the table tblProperies uses tblFile.ID as a foreign key and
the table tblProgram Also uses it as a foreign key. Actually there's
3 rows in property that uses a specified ID from tblFile and no rows
from tblProgram uses it.

So actually I want my query/function to return : "tblProperties" only.

Actually i don't know anything about this concern so please somebody
give me a hand!


You can get NavQueries from my site. See under Tools.

It is a nice little tool form that shows information about the structure
of your queries, you can find/filter to see only queries containing
'tblFile.ID' for instance.

You can query the MSysQueries table yourself; I believe the column
expressions have attribute=6. A quick test results in this statement:

SELECT MSysObjects.Name, MSysQueries.Expression
FROM MSysQueries INNER JOIN MSysObjects ON MSysQueries.ObjectId =
MSysObjects.Id
WHERE (((MSysQueries.Attribute)=6) AND ((MSysQueries.Expression) Like
"*ID*"));

Have Fun.
--
Bas Cost Budde
http://www.heuveltop.org/BasCB
but the domain is nl

Nov 12 '05 #3

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

Similar topics

5
by: Olivier Crèvecoeur | last post by:
Hello, Excuse me for my poor english. I would kike know if create index on the foreign key it's necessary or if Oracle, are optimized for using foreign key whithout index. Best regards ...
4
by: Dmitri Shvetsov | last post by:
Hi, What methods can we use to check the integrity problems? Some records in my database are having Foreign Keys but the database doesn't have any related records with required Primary Keys. I...
10
by: Bodza Bodza | last post by:
I'm having an argument with an incumbent self-taught programmer that it is OK to use null foreign keys in database design. My take is the whole point of a foreign key is that it's not supposed...
0
by: Scott Ribe | last post by:
I've got a problem which I think may be a bug in Postgres, but I wonder if I'm missing something. Two tables, A & B have foreign key relations to each other. A 3rd table C, inherits from A. A...
0
by: elvin | last post by:
Okay - apologize in advance for the length, but I want to make sure all you knowledgeable and helpful people have all the details you need to hopefully point my newbie rear in the right direction....
5
by: Ross A. Finlayson | last post by:
Hi, I'm scratching together an Access database. The development box is Office 95, the deployment box Office 2003. So anyways I am griping about forms and global variables. Say for example...
2
by: Ian Davies | last post by:
I have created a database with about 17 tables. I have been creating foreign keys some of which have worked but when creating others I get the message below ************************* 1005...
9
by: sonal | last post by:
Hi all, I hv started with python just recently... and have been assigned to make an utility which would be used for data validations... In short we take up various comma separated data files for...
1
by: apax999 | last post by:
Kinda new to SQL, using SQL Server 2005. I have some foreign keys in a couple of tables. I need to drop these tables, but can't since I'll get the error: Msg 3726, Level 16, State 1, Line...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.