473,497 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Table As A SubTable Of A Query

1 New Member
I am very new to Access.

I have simplified my data in order to isolate my problem which is as follows.

I currently have a task that I organize on paper and would like to write a database to do it.

The task is tracking review dates for stocks I follow and storing summary notes for each successive review.

What I do now is write the next date I wish to review a stock on a calendar. When that date arrives I do the review and write a summary which I store in binder with other summaries for the same stock.

My plan for organising this in Access is:

To create two tables.

One table, called Stocks, has two fields in each record. One field (the key field) is for the Ticker Symbol of the stock. The second field is for it's next review date.

The second table, called Summaries, has four fields. One is an auto generated key field, one is for the Ticker Symbol of the Stock the summary is on (A lookup field from the Stocks Table) and the date the summary is done.

I can open the Stocks Table, sort it by review date, and see any stocks that are due for a review. For those that are, as the Summaries table is a Subtable of Stocks, I can click on the + sign for the record that holds the stock I want to review, write the summary in a new record, and add the date I have done it on. This works fine.

But, as it's a learning project (one that I can build upon to eventually incorporate forms etc) I would like to Query the Stocks table for only records that have a review date on or before today. I would like to then assign the Summaries Table as a Subtable of the query and have it work the same as it does in the above paragraph.

When I try and do this, however, all the records in the Summaries table appear beneath each record in the query I expand the subtable for.

I have tried adding a relationship between the Ticker Symbol field in the query and both of the other tables, exclusively and at the same time but that didn't work.

I would really appreciate any guidance.

Thanks
Aug 1 '12 #1
4 3987
Rabbit
12,516 Recognized Expert Moderator MVP
Can you post the SQL that you're using?
Aug 1 '12 #2
Seth Schrock
2,965 Recognized Expert Specialist
I would highly recommend reading the following link: Database Normalization and Table Structures. This will help you design your database so that it can be added to very easily without major changes to your existing design. Also, you gain much more control over your data if you use forms to view the data instead of looking at the table.
Aug 1 '12 #3
ariful alam
185 New Member
If you need to show the specific data from table B based on table A's selected data, than you should use Form. Create a form for table A and add table B as a sub form of the form that created for table A. When you add table B as a sub form in form A, a window will appear to link the form records based on a common/key field. choose, by own and specify the field name in both form to link the records.

Thanks
Aug 2 '12 #4
twinnyfo
3,653 Recognized Expert Moderator Specialist
AJJR,

I think I have a very easy solution for you. I just created a main form for your Stocks, showing the next review date. However, I filtered that form by all dates <= Date().

Then I created a subform for your summaries, but it is filtered by only dates >= Date(). These are Master/Child by the Stock ticker primary key.

Whenever a summary is due, you can add your summary. When you click save, the current date is saved to the summary table and it resets the next summary date (arbitrarily 7 days from now).

Hope this helps, but I agree with others, that you should take a look at normalization first.
Attached Files
File Type: zip Stocks.zip (43.9 KB, 125 views)
Aug 2 '12 #5

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

Similar topics

2
12857
by: Siva | last post by:
Hi, i want to know, how to get the structure of the table in query format(create table ...). any one can help me. bye & thanxs Siva Prakash. M
1
9011
by: Philehof | last post by:
Hi Group. I would like to add some information to a query. I tried to create a table with the information from the query but then if i run the query again the additional data will be lost. ...
3
2851
by: Andrew | last post by:
Hi All I wonder if anyone can help me with this. The scenario is that I have a pair of related tables. One contains record labels, the other contains contact names at those labels. In the...
1
8314
by: babyjek | last post by:
SELECT ProjectID, ProjectName, ProjectDescription, SequenceNumber, LastUpdateDate FROM Project WHERE ProjectID = @ProjectID; (The Microsoft Jet database engine cannot find the input table or...
0
985
by: Hemant Pathak | last post by:
Hi All i m working in Vb 6.0 and Access 2000 i want to export Table or Query Source database to Destination Database
2
5107
rsmccli
by: rsmccli | last post by:
I am getting this error using Refreshlink from code. No problem for admins, only some normal users. It says Error 3111: you have no permissions for Table or Query TMP%#MAU@. This object does not...
6
3652
by: warpcon | last post by:
Im trying to build a database starting with one of the templates that come with access. I took out the employee part in all the tables and forms. Now when I pull up a workorder and then try to view...
0
1147
by: Giero | last post by:
Hello, I have a little problem with my database. I created table where one of the fields is hyperlinked and is linking to the .doc files stored on the network drive. I can get the queries and...
3
5517
by: rinu911 | last post by:
hi all I am tring to insert a values to a table by checking if the value is there in the table already but it gives me this error "Query input must contain at least one table or query" ...
2
3566
by: KMEscherich | last post by:
Hi there, as I am totally new at this, can someone please give me detailed information on how to get Access table or query data to display onto a Dreamweaver page??? Thank you.
0
7120
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
6991
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
7196
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...
1
6878
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
7373
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
5456
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4583
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1405
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.