Solved

create relationship from table to view

Posted on 2013-06-23
8
555 Views
Last Modified: 2013-06-25
hey guys i'm just curious. in the relationships table i can add both tables and queries to the canvass.

1) can i create a relationship from a query to a table or i can't, it's just there for me to visually see the select query?

(i tried creating a relationship from the select query to the table but the below is what it shows me)

2) i've heard about views. is a select query a view? so all my select queries in access are views right? if they're not, what's the difference between a view and a select query? thanks!

viewtotable
0
Comment
Question by:developingprogrammer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 48

Expert Comment

by:Dale Fye (Access MVP)
ID: 39269245
Yes,  you can create a relationship between a query and a table (in the query designer or SQL view).  When you try to create the relationship and double click on the line joining the two tables, it will display the table/query names at the top and the fields that are currently linked in the section above the check boxes.

A "view" is the term that SQL Server uses for saved queries, it is not usually a term associated with Access queries.
0
 
LVL 50

Assisted Solution

by:Gustav Brock
Gustav Brock earned 50 total points
ID: 39269259
The difference is that when using a query, the relationsship is just informal and for display only - that why the three textboxes are greyed out.

/gustav
0
 

Author Comment

by:developingprogrammer
ID: 39270253
hrmm ok let me try and develop the queries for my DB and see if i need relationships and as such would have real test cases to better understand this. but thanks for your help gustav and fyed!! let me get back to yall in awhile ya! = )
0
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 
LVL 48

Expert Comment

by:Dale Fye (Access MVP)
ID: 39270926
When you are building table relationships, it is generally to ensure some form of referential integrity (ie, you must have a matching record in one table for an entry in another table).  An example of this would be a States table and an Address table.  With a properly defined relationship, you would not be able to enter ZZ as a [StateCD] field in tblAddresses if there is not a matching [StatesCD] value in tblStates.

However, when a relationship is defined in a query, it is normally so that you can retrieve other information from a second table, based on the value in the first table.
0
 
LVL 11

Accepted Solution

by:
datAdrenaline earned 350 total points
ID: 39272362
"Yes,  you can create a relationship between a query and a table"

You are not creating a Relationship in this scenario.  You are merely defining how you want the AutoJoin feature of the Access UI will JOIN when using both the Query object and Table object in another Query object.

Remember, a Relationship (with R/I, of course) is a constraint that governs data going into the database must adhere to.  A JOIN is how the data is presented to the user.  A "Relationship" without R/I is, again, a simply a suggested JOIN for the AutoJoin feature.
0
 
LVL 48

Assisted Solution

by:Dale Fye (Access MVP)
Dale Fye (Access MVP) earned 100 total points
ID: 39272639
datAdrenaline,

Your are, of course, correct about the difference between a "relationship" and "join".  I stand corrected, and should have used the word JOIN in both my earlier posts when referring to queries.

Dale
0
 

Author Closing Comment

by:developingprogrammer
ID: 39272682
whao guys, thanks so much for your help and guidance and the culture here is really humbling and wonderful seeing how we all learn from each other and progress along together. thanks guys once again and yall are really wonderful!! = )
0
 
LVL 11

Expert Comment

by:datAdrenaline
ID: 39275022
You're welcome!  Good luck on your project!
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question