473,804 Members | 3,203 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Link Subdatasheet tbl to 2 columns of another tbl

17 New Member
In Access 2007, I've created a table (Companies) with two Child Fields (Production & Distribution (both columns in the main tblClients)). The Subdatasheet of tblCompanies however only shows the info from the tblClients if the values in the Production and Distribution fields are exactly the same.
Is it possible to have both shown in the Subdatasheet? Meaning if two different companies were involved, it will show the Client info at company A but also at company B (thus potentially having the same record twice in the Subdatasheet).

Thanks in advance Margie
Mar 8 '08 #1
10 5636
NeoPa
32,579 Recognized Expert Moderator MVP
Are you talking about a subform? If so, I think you need to be a little more specific about how the subform is linked to the main form, and how the tables are linked in the database too.

My guess (with so little clear info) is that you would need to have separate sub-items (subform whatever) to handle the two distinct links rather than trying to link them in what seems an illogical way.
Mar 9 '08 #2
ADezii
8,834 Recognized Expert Expert
In Access 2007, I've created a table (Companies) with two Child Fields (Production & Distribution (both columns in the main tblClients)). The Subdatasheet of tblCompanies however only shows the info from the tblClients if the values in the Production and Distribution fields are exactly the same.
Is it possible to have both shown in the Subdatasheet? Meaning if two different companies were involved, it will show the Client info at company A but also at company B (thus potentially having the same record twice in the Subdatasheet).

Thanks in advance Margie
Your question is a little hazy, but if I interpret it correctly, I can tell you that you can only have 1 Subdatasheet View for a given Table at a time, but all is not lost. You can also have a different Subdatasheet View of the same Table data by:
  1. Create a Query based on all Fields contained in the Table.
  2. Open the Query in Datasheet View.
  3. Insert.
  4. Subdatasheet.
  5. Select the alternate Child Table.
  6. Enter a value for Link Child Fields.
  7. Enter a value for Link Master Fields.
To Remove a Subdatasheet:
  1. Open Query in Datasheet View.
  2. Format.
  3. Subdatasheet.
  4. Remove.
Mar 10 '08 #3
Margie
17 New Member
To prevent a huge post, it appears I have left too much info out. I will try your suggestion ADezii, but first this post to see if we (and NeoPa) are on the same track.

I have a main table: Clients
Around the main table I build a form: Clientview
The info you enter in the form is taken from (but can also put into if info doesn't exist) several other tables. In the form there are for instance 2 fields for companies (Production & Distribution). This specific info comes from the table Companies. Now Access automatically created a subdatasheet in the table Companies which shows all the info from the main table Clients.
The problem is that the subdatasheet only shows the info if the 2 fields (Production & Distribution) are exactly the same.
- Example 1:
the value in the Production field: Microsoft
the value in the Distribution field: Microsoft
-> in the table companies you look at the subdatasheet of the record Microsoft and you can see all the client info from the main table Clients

- Example 2:
the value in the Production field: Microsoft
the value in the Distribution field: TheScripts
-> in the table companies if you look at the subdatasheet of either the record Microsoft or the record TheScripts, it doesn't show any Client info at all.

If I look at Insert Subdatasheet of the table Companies, it shows 2 things.
- The table Companies has:
Link Child Fields: Companies
Link Master Fields: Companies
- The table Clients has:
Link Child Fields: Production;Dist ribution
Link Master Fields: Companies;Compa nies

What I would like is for the client info to be shown at the record Microsoft but also at the record TheScripts. As for the 'best' solution, if it means building a new reorganized database, I have no problem with that. It's part of the learning process. I hope I made it all more understandable with this post. :)
Mar 11 '08 #4
ADezii
8,834 Recognized Expert Expert
Just checking, will return at a later time.
Mar 11 '08 #5
NeoPa
32,579 Recognized Expert Moderator MVP
Margie,

I'm not very familiar with displaying linked tables in sub-datasheets, but it seems (logically) very similar to producing a query with linked tables where the tables are equivalent to the tables listed in a FROM clause and the links are as defined in the ON part of that same (FROM) clause. The JOIN type would be a LEFT JOIN with the two fields you have listed (Production & Distribution) both having to match Companies. It seems this is exactly what you're getting.

You can show what you need with a more sophisticated query (OR rather than AND and two separate instances of the child table linked) but I'm fairly certain that Access won't do this for you at a sub-datasheet level.

This would be easier to deal with (explain and work on) if you provided MetaData for the relevant tables (Master & Child in this case). Here is an example of how to post table MetaData. Please use this format in your post :
Expand|Select|Wrap|Line Numbers
  1. Table Name=[tblStudent]
  2. Field; Type; IndexInfo
  3. StudentID; AutoNumber; PK
  4. Family; String; FK
  5. Name; String
  6. University; String; FK
  7. Mark; Numeric
  8. LastAttendance; Date/Time
Of course, if you are now satisfied with the answers so far, then there's no further need for it.
Mar 11 '08 #6
Margie
17 New Member
First off, sorry for the delay. Running a home, going to work and going to school tend to get overwhelming some times and one has to prioritize. And a movie database is ranked low :) . So again sorry for the wait.
If I understand it correctly, MetaData is basicly the design of a table. This info can be seen in Design View correct? If so, this is the info of the main table:
Expand|Select|Wrap|Line Numbers
  1. Table Name=[Clients]
  2. Field; Type; IndexInfo
  3. ID; AutoNumber
  4. Ok; Yes/No
  5. Status; Text
  6. Property; Text
  7. Client Title; Text
  8. Titles Alt; Text
  9. Series Current; Text
  10. Series Total; Text
  11. Series Name; Text
  12. Production; Text
  13. Distribution; Text
  14. Poster; Attachment
  15. Budget; Text
  16. Genre 1; Text
  17. Genre 2; Text
  18. Genre 3; Text
  19. Year; Text
  20. Grade; Text
  21. Rating; Text
  22. Duration; Text
  23. Country 1; Text
  24. Country 2; Text
  25. Country 3; Text
  26. Direct 1; Text
  27. Direct 2; Text
  28. Direct 3; Text
  29. Cast 1; Text
  30. Cast 2; Text
  31. Cast 3; Text
  32. Cast 4; Text
  33. Person 1; Text
  34. Person 2; Text
  35. Person 3; Text
  36. Person 4; Text
  37. Link MM; Hyperlink
  38. Link IMDB; Hyperlink
  39. Plot; Text
  40. Date View; Date/Time
  41. Date Vote; Date/Time
  42. Remarks; Text
  43. Review; Text
  44.  
Now, if I understand ADezii correctly, one way to get the desired info is creating a query with the alternate child field link. One query would be for Production and the other for Distribution. This works but the problem in my case is that I have many fields (just look in the code) with the same problem.
For example, I have a table Cast (Field Name: Cast & Data Type: Text) linked to Cast 1, Cast 2, Cast 3 and Cast 4. And 1 query for each field seems a little too much.

Hope this info helps and I'm off to continue with my efforts in getting the data I want into 1 query instead of several queries.

Thanks again :)
Mar 15 '08 #7
NeoPa
32,579 Recognized Expert Moderator MVP
First off, sorry for the delay. Running a home, going to work and going to school tend to get overwhelming some times and one has to prioritize. And a movie database is ranked low :) . So again sorry for the wait.
This is not a problem. The beauty of a forum based help system is that immediate responses are not really required.

Members post when they can, and the experts do the same. An apology more than covers the delay.
Mar 16 '08 #8
NeoPa
32,579 Recognized Expert Moderator MVP
Margie, I've had a little play around in my test database and it seems that subdatasheets are limited to one per table.

I set up a table with two unique indices and when I tried to expand the subdatasheet, it asked me to select what I wanted. Now there may be scope here for something clever, but it certainly wouldn't allow me to set up or use more than one of them.

This is not an area of expertise for me so I will leave it there. If ADezii has anything different to say then you may want to wait for his response. However, you may have to resign yourself to missing out on this feature for this particular table.
Mar 16 '08 #9
NeoPa
32,579 Recognized Expert Moderator MVP
Just as a snippet of information though, in case you were not aware, you can link tables in a query where a number of fields reference the same table by including the table in the FROM clause multiple times (with aliases) as follows :
Expand|Select|Wrap|Line Numbers
  1. SELECT tC.Cast1,
  2.        tC1.CastName AS Cast1Name,
  3.        tC.Cast2,
  4.        tC2.CastName AS Cast2Name,
  5.        tC.Cast3,
  6.        tC3.CastName AS Cast3Name,
  7.        tC.Cast4,
  8.        tC4.CastName AS Cast4Name,
  9.        ...
  10. FROM ((([Clients] AS tC LEFT JOIN [Cast] AS tC1
  11.   ON tC.Cast1=tC1.Cast) LEFT JOIN [Cast] AS tC2
  12.   ON tC.Cast1=tC2.Cast) LEFT JOIN [Cast] AS tC3
  13.   ON tC.Cast1=tC3.Cast) LEFT JOIN [Cast] AS tC4
  14.   ON tC.Cast1=tC4.Cast
I use t as a prefix for my aliases to indicate table. Hence, tC4 == {table Cast 4}.
Clients doesn't need to be aliased, I just would to keep the table references shorter when referring to fields.
Mar 16 '08 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

0
356
by: Paul Malcomson | last post by:
Hi. I'm having terrible trouble with a form that displays several parent/child relationships at one time. It is a sales force hierarchy - Sales force, district, territory, sales rep are the tables linked in parent/child relationships. I'm using a form to choose the main-parent and then several subforms in datasheet view.
1
1919
by: astro | last post by:
I'm trying to get a subdataSheet embedded on a form which will be displayed in datasheet view. I setup the 'record source' for the form to a query on a table. I go into the query properties and setup a subdatasheet. I test this and it works. I close the query builder - get prompted to save - reply yes. I reopen the 'record source' and the subdatasheet setting are gone. Any ideas?
0
1350
by: Philipp | last post by:
Hey @ all! I have a very big problem, I hope someone have an idea: I have a datasheet an one subdatasheet, via VBA i can expand all records from the subdatasheet, but can I only expand one record!??? Please help me! Thank you very very much!
2
4490
by: James | last post by:
Hi I have set up a subform in datasheet mode containing a second subform also in datasheet mode in order to be able to open it as a subdatasheet. In my application I make the first subform appear and disappear using the Visible property. If I make it visible (in code), open the subdatasheet (via mouse) and click anywhere on the subdatasheet, then make it invisible (in code) I get the infamous error 2165 'You can't
2
2094
by: karen scheu via AccessMonster.com | last post by:
I am having trouble lately opening my local tables. It is taking a a few seconds to open the table that has no records in it. I read that there is a bug with the AutoCorrect feature and so I set that option off in my DB which is an Access 2002-2003 database, then tried to set the subdatasheet to none, but every time I get back into it, it goes back to Auto. How can I set it to none and have it stay. I also tried creating a new MDB and...
3
2175
by: debbie | last post by:
I have an Access 2002 program that I install using Wise. The first thing my program does when a front end is opened is re-link, then it checks the version and if needed upgrades the backend. My problem is that I have a new front end version upgrade that creates several new tables in the backend and then links them. So when the program opens up it checks the version in the backend and if needed creates new tables & new links. Now when...
8
4994
by: ray | last post by:
I am at the moment manually setting Subdatasheet to in all the tables in this adp. If anybody can put me out of my misery by suggesting some automated way to do it, I would be most grateful. I can't work out how to get ADO or the ADOX catalog to do it, and DAO doesn't connect to projects. I am now up to table 75 out of 425 in Systest, and I will have to do it again in UAT and Prod. Ewwwww. This is the thirty-eighth most boring thing I...
0
1367
by: burningthemidniteoil | last post by:
I have access 2002. I have a query that diplays a subdatasheet ( +/- subtrees are shown on the record), but when i make a datasheet form out of that query , it does not display the plus (+) and minus(-) trees. Q. How do you display a subdatasheet in a datasheet form. Note, i do not want to display a subform i want to display a subdatasheet. There are subdatasheet properties on the form under format but they don't do anything??
8
20941
dima69
by: dima69 | last post by:
Hi everybody. Here is another problem I cannot find the solution. I have a form with subform. In datasheet view, the subform related to current record can be expanded as subdatasheet by clicking on the "+" sign. So the question is how to expand SINGLE subform from VB code. Note that SubdatasheetExpanded form property doesn't help here, since it affects ALL the subforms in current datasheet view.
0
9708
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
9587
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
10588
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
10340
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10324
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7623
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
5527
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3827
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2998
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.