By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,689 Members | 1,718 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,689 IT Pros & Developers. It's quick & easy.

Show if a parent record has a child record.

P: n/a
In a query, I need too be able to show if a parent record has a child
record.

Using the query in a combo box too select record in a form.

Thanks
:)
Nov 12 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
The only way I know of to get there in a single level query is to interpret
your results; if the parent level shows multiple times, that's how many
child records there are.

It is common to use form/subform to track the parent on the form and show
the children on the subform. Another way to get there might be to use the
old Outline control or the more current Treeview control.

HTH
--
-Larry-
--

"news.online.no" <bo***@hilden.123no> wrote in message
news:fk******************@news4.e.nsc.no...
In a query, I need too be able to show if a parent record has a child
record.

Using the query in a combo box too select record in a form.

Thanks
:)

Nov 12 '05 #2

P: n/a
My combobox is showing all off my customers. I want too see whish customer
has a service agreement. The combobox schould then show 2 fields. Name of
the customer and Yes on those having a service agreement.

:)
"Larry Daugherty" <la*********@NoSpam.earthlink.net> skrev i melding
news:XA******************@newsread2.news.pas.earth link.net...
The only way I know of to get there in a single level query is to interpret your results; if the parent level shows multiple times, that's how many
child records there are.

It is common to use form/subform to track the parent on the form and show
the children on the subform. Another way to get there might be to use the
old Outline control or the more current Treeview control.

HTH
--
-Larry-
--

"news.online.no" <bo***@hilden.123no> wrote in message
news:fk******************@news4.e.nsc.no...
In a query, I need too be able to show if a parent record has a child
record.

Using the query in a combo box too select record in a form.

Thanks
:)


Nov 12 '05 #3

P: n/a
Larry,

Your tables should look something like:
TblCustomer
CustomerID
CustomerName
Etc

TblServiceAgreement
ServiceAgreementID
CustomerID
SGDate
Etc

1. Create a query that includes both tables.
2. Join both tables on CustomerID
3. Click on the join line. In the dialog that appears, change the join to the
option that says include all records from TblCustomer and only the matching
records from TblServiceAgreement.
4. Pull down CustomerID and CustomerName from TblCustomer into the first two
fields of the query.
5. Put this expression in the third field of the query:
HasServiceAgreement:IIF(IsNull(TblServiceAgreement .CustomerID),"","Yes")
6. Set the Bound Column to 1
7. Set Column Count to 3
8. Set Column Widths to 0;2;.5

Make this query the row source of your combobox.
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"news.online.no" <bo***@hilden.123no> wrote in message
news:rX******************@news4.e.nsc.no...
My combobox is showing all off my customers. I want too see whish customer
has a service agreement. The combobox schould then show 2 fields. Name of
the customer and Yes on those having a service agreement.

:)
"Larry Daugherty" <la*********@NoSpam.earthlink.net> skrev i melding
news:XA******************@newsread2.news.pas.earth link.net...
The only way I know of to get there in a single level query is to

interpret
your results; if the parent level shows multiple times, that's how many
child records there are.

It is common to use form/subform to track the parent on the form and show
the children on the subform. Another way to get there might be to use the
old Outline control or the more current Treeview control.

HTH
--
-Larry-
--

"news.online.no" <bo***@hilden.123no> wrote in message
news:fk******************@news4.e.nsc.no...
In a query, I need too be able to show if a parent record has a child
record.

Using the query in a combo box too select record in a form.

Thanks
:)



Nov 12 '05 #4

P: n/a
On Thu, 11 Dec 2003 22:28:40 +0100, "news.online.no"
<bo***@hilden.123no> wrote:
In a query, I need too be able to show if a parent record has a child
record.


Did you try a SQL JOIN on the two tables?

--
Mike Sherrill
Information Management Systems
Nov 12 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.