help with a table and a subform and a query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Ok, hi.

I have a comments table to store comments related a specific document. The
table is used as a subform on the main data entry form.

Now, when I run queries to search for documents, if there is more than one
comment for a document, the query will return multiple rows of the same
document based on the number of comments for that document. So if there are 3
comments for a document, if I search for that document, 3 rows of the same
document will be returned.

Why is this? How can I set this up so regardless of the number of comments a
document has, it will only show up once in query results?

Thanks for any help or suggestions you can provide.

-justin
 
justin said:
Ok, hi.

I have a comments table to store comments related a specific
document. The table is used as a subform on the main data entry form.

Now, when I run queries to search for documents, if there is more
than one comment for a document, the query will return multiple rows
of the same document based on the number of comments for that
document. So if there are 3 comments for a document, if I search for
that document, 3 rows of the same document will be returned.

Why is this? How can I set this up so regardless of the number of
comments a document has, it will only show up once in query results?

Thanks for any help or suggestions you can provide.

-justin

Why would you want a query to return just one comment about a document?
If you want to see comments for the documents, don't you want to see all the
comments?

Now if you want to see the document reference and a list of comments
after it, then you want to use a form - subform.
 
I don't want a query to return just one comment. I want the query to return
everything it currently returns, but instead of having multiple rows of the
same contract because it has multiple comments, I want to have one row for
each contract that has multiple comments in the comments field.

Would I setup that comments field as a listbox on the query? So when you
scroll to that column you just click the tab to view the rest of the comments?

It currently is setup as a form and a subform. Do you mean table and
subtable? If that's the case, can a query have subtables in the output?

-justin



Joseph Meehan said:
Why would you want a query to return just one comment about a document?
If you want to see comments for the documents, don't you want to see all the
comments?

Now if you want to see the document reference and a list of comments
after it, then you want to use a form - subform.
Original message:
 
justin said:
I don't want a query to return just one comment. I want the query to
return everything it currently returns, but instead of having
multiple rows of the same contract because it has multiple comments,
I want to have one row for each contract that has multiple comments
in the comments field.

Would I setup that comments field as a listbox on the query? So when
you scroll to that column you just click the tab to view the rest of
the comments?

It currently is setup as a form and a subform. Do you mean table and
subtable? If that's the case, can a query have subtables in the
output?

No there is no such thing as a sub-table.

The best suggestion I can think of is the form-subform construction.
You can play around with them and you may like the results. They don't have
to look the way the wizard makes them look
 
I don't understand what you mean by form-subform contruction. How can I make
a query based off of a form or subform? I didn't think that was possible.

Can you elaborate on what you're trying to say? Thanks.

-justin
 
justin said:
I don't understand what you mean by form-subform contruction. How can
I make a query based off of a form or subform? I didn't think that
was possible.

Can you elaborate on what you're trying to say? Thanks.

-justin

You don't make a query from a form or sub-form. Actually you make the
form and subform from the query.

Load up the Northwind database and look at the "Customers" form. That
is an example of a form sub-form.
 

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

Back
Top