Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Is there any way to create 2 subtables for a main table?

Posted on 2006-04-17
9
Medium Priority
?
641 Views
Last Modified: 2012-05-05
Our lawfirm MS Access database has multiple tables and forms (as does everyone). Often, I, meaning ME, want to look at a table of data (NOT A FORM) with 2 subtables. Main table is CONTACTS, subtables are LITIGATION INFORMATION, and MONIES IN. The main table key is "CONTACT ID," an autonumber field for CONTACTS; The subtable key for LITIGATION INFORMATION is "ID," an autonumber field, and the subtable key for MONIES IN is "INVOICE #," also an autonumber field;

I want the parent field as CONTACT ID, and the child fields to be ID and INVOICE #. However, when I use both fields, it restores back to AUTO each time. Any suggestions?

Please be advised, this IS NOT FOR MY USERS, this is only for my use (usually, it's a quick and dirty table search for data not searchable by the users). Is there any way to have the multiple subtables...YES, I already know it is not the preferred way, but it's just for my usage. Can it be done, and if so, how?

Thanks for your help guys, much appreciated in advance.

Michael
0
Comment
Question by:satzm
  • 4
  • 4
9 Comments
 
LVL 58

Expert Comment

by:harfang
ID: 16474060
Hello,

You want to look at a table, with two different subdatasheets? Are they cascading? I.e. is MONIES IN a subdatasheet of  LITIGATION INFORMAITON? If so, you can do that. If now, there is no way around it. Normally, you can trust Access with automatic linking of subdatasheets, just tell it which you want, and it will be OK -- provided the proper relationships have been set up.

The you might have some confusion about "master" and "child" fields. In your example, CONTACT ID will always be the "master" field for the subdatasheet. The "child" field can only be the related field, probably also called CONTACT ID, as found on LITIGATION INFORMATION or MONIES IN (this is not clear from your explanations). However the "child" field will *never* be INVOICE #. This would mean that for CONTACT n°123, you want to see the INVOICE n°123...

Does that clarify?
(°v°)
0
 

Author Comment

by:satzm
ID: 16475237
No, MONIES IN is not a subdata sheet of LITIGATION INFORMATION, they are both "subforms" of the main form, CONTACTS, but not on the tables. They are indeed related, i.e. CONTACTS is the main table, related by a one to many relation for MONIES IN, and a one-to-one relationship for LITIGATION INFORMATION, but when I click on the PLUS sign for the CONTACTS Table, it makes me choose one or the other...I need both to load (to track litigation and the monies for filing, sheriff costs, settlement amounts, etc.) when clicked. Is it possible?

But, are you suggesting each related field in each table should have the same "master" name as CONTACT ID? Perhaps I have set up my database incorrectly, if you state such!

Please advise asap!

Thanks,

Michael
0
 
LVL 17

Expert Comment

by:Natchiket
ID: 16475723
Why don't you just create a query with the three tables in and look at that ?
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 

Author Comment

by:satzm
ID: 16477649
Because usually, it's to find a defendant or plaintiff from abnormal or partial search parameters, i.e. a first name, a partial phone number, a partial zip code, a state: sorted)...things other than the standard search parameters...and I would have to create a new query for something that is essentially disposable and only used once.

Instead, if I could do this on my FE, for my FE as opposed to my users, it is much simpler for me. I thought I saw something about this in one of the help files previously, but can't find it anymore. Can anyone help?
0
 
LVL 58

Expert Comment

by:harfang
ID: 16478475
> They are indeed related, i.e. CONTACTS is the main table, related by a one to many relation for MONIES IN, and a one-to-one relationship for LITIGATION INFORMATION,

In that case, it's possible to throw everything together.

1) Create a new query based on CONTACTS and LITIGATION INFORMATION.
2) Set the proper relationship between them (the one-to-one link on CONTACT ID to ID?)
3) Double-click that link if you want to make certain that you see all contacts, even those without a matching record in the second table.

* Test the query. You should see all fields (or those you selected) from both tables, side-by-side.

4) Open the query properties and set this Subdatasheet Name: Table.MONIES IN
5) Set the appropriate names for link master field, i.e. CONTACT ID, and link child field, i.e. the one linking back to the contacts table.

You should now see rows with information from two tables, the [+] opening the subdatasheet for the third table.

Note, if you don't want all fields from MONIES IN, you can first create a query and then use that query as subdatasheet instead of the raw table.

Good luck!
(°v°)
0
 

Author Comment

by:satzm
ID: 16479369
Harfang: regretfully, I already tried this, and it simply merged the data of the contacts table and the litigation information onto one table...as the Contacts file has about 200 fields, and the litigation information has about 25 fields, and the Monies in field has about 10 fields, I need to have the "subtable" with a plus sign for both tables at the same time. Can this be accomplished? Thanks for the help.
0
 
LVL 58

Accepted Solution

by:
harfang earned 1000 total points
ID: 16483617
Well, in that case, the answer is no.

In "datasheet view", you can have only one active "subdatasheet" at a time. What you request is possible to some extent in Excel (but you still need one row for each + sign) so that you could have someone design an export that also creates the groups.

In Access, besides the query solution {http:#16478475} which you reject, you can use a main form showing Contacts, a second tab showing litigation information (as a left-join query or as a subform), and a subform (below or as a third tab) containing the "monies in". Anyway, if you need to display 225 fields plus several 10-field records, you will be better off with some amount of page layout and information grouping.

Again, the answer to "I need to have the 'subtable' with a plus sign for both tables at the same time" is "it can't be done".

Sorry!
(°v°)
0
 

Author Comment

by:satzm
ID: 16530542
Thanks for the assist, but I have to tell you...I saw a help screen previously that stated it could be done...I just don't remember how. Thanks for the help regardless though!!!
Michael
0
 
LVL 58

Expert Comment

by:harfang
ID: 16530700
Hmm.
Why the "C" grade? I offered three workaround, and "it can't be done" is sometimes the correct answer.

Perhaps you should check out these links:
 • What's the right grade to give? {http:/help.jsp#hi73}
 • What's with the points? {http:/help.jsp#hi20}

Anyway, here is a bonus fourth solution, in the likely case that the same key is used for both relations:
 • Create a datasheet for CONTACTS
 • Sub-datasheet for MONIES IN
 • Sub-subdatasheet for LITIGATION INFORMATION
   [using MONIES IN key, which is == CONTACTS key]
Drawback: works only if there is a record in MONIES IN...

Again, as far as I know, you cannot have two [+] columns... sorry!

(°v°)
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

810 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