Data in table but not in Query/Report

M

magicpatel

I have a form that saves data to various tables using code, and this
all seems to work.

But when i try to run a query on some of the tables, some data is
displayed, but anything newly added through the form isnt shown. Whats
strange is that the data is correctly in the respective tables?!

Maybe its something to do with the way I add it to the tables using
code (dirty)?

Heres the query/sql that im using:

SELECT [TitleAreas].[FieldSetOrder], [TitleAreas].[FieldTitleArea],
[Topics].[FieldTopic], [References].[FieldRefNo]
FROM (Topics INNER JOIN (TitleAreas INNER JOIN Titles_Topics ON
[TitleAreas].[TitleID]=[Titles_Topics].[TitleID]) ON
[Topics].[TopicID]=[Titles_Topics].[TopicID]) INNER JOIN ([References]
INNER JOIN Topics_References ON
[References].[RefID]=[Topics_References].[RefID]) ON
[Topics].[TopicID]=[Topics_References].[TopicID]
ORDER BY [TitleAreas].[FieldSetOrder];


Any thoughts would be very helpful.

Thanks in advance.
 
J

Jerry Whittle

The SQL shows inner joins between all the tables. If any of the tables do not
have a related record none of the data will show. You may need to use some
left joins if this is the case.
 
M

magicpatel

Thanks for the info. I'm not too sure what left joins are?!
I'll try and look it up, but a simple example would be useful.

The query is producing some of the data in the tables, however. Just
not newly added ones. I have added a delete button on the form which
removes records using code from the link entity/tables depending the
selection on the form listbox. Perhaps this is causing problems with
the index, in turn with the query? -- Note: all tables have autonumber
keys, so this shouldn't happen right?

Thanks again
 
J

Jerry Whittle

To test the various joins, open the query in design view. Double-click on the
line between the two tables until a dialog box pops up. There are three
options and the top one, the inner join, is probably selected. Try the second
option which is the left join. If that doesn't work, try the last option
which is a right join.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top