PC Review


Reply
Thread Tools Rate Thread

Count ID from one table that matches another and show in a form...

 
 
DH010010
Guest
Posts: n/a
 
      15th Nov 2008
i have two tables one "job details" and another "additional jobs". the "job
details" table holds all the main information customers name and what job is
to be carried out ect. if they would like additional jobs they are stored in
the "additional Jobs" table linked to "job details". now in the form that
enters and displays this information i have an unbound box which i would
like to display the total number of jobs to be complete for that customer.

anyhelp on this would be great.
 
Reply With Quote
 
 
 
 
Ken Sheridan
Guest
Posts: n/a
 
      15th Nov 2008
Set the ControlSource property of the text box to:

=DCount("*","[Additional Jobs]","[JobID] = " & [JobID])

Where JobID is the primary key of the Job Details table and the
corresponding foreign key column in the Additional Jobs table. If JobID is
text rather than a number wrap the value in quotes characters like so:

=DCount("*","[Additional Jobs]","[JobID] = """ & [JobID] & """")

If you want to include the main job in the count as well as the additional
jobs then add 1:

=DCount("*","[Additional Jobs]","[JobID] = " & [JobID])+1

You could also, if you wish, include a continuous or datasheet view subform
based on the Additional Jobs in the main form provided this is in single form
view, linked on JobID. That way you'd see the additional jobs for the
current job listed, and be able to add, delete or edit additional jobs all
through the one form/subform.

Ken Sheridan
Stafford, England

"DH010010" wrote:

> i have two tables one "job details" and another "additional jobs". the "job
> details" table holds all the main information customers name and what job is
> to be carried out ect. if they would like additional jobs they are stored in
> the "additional Jobs" table linked to "job details". now in the form that
> enters and displays this information i have an unbound box which i would
> like to display the total number of jobs to be complete for that customer.
>
> anyhelp on this would be great.


 
Reply With Quote
 
DH010010
Guest
Posts: n/a
 
      15th Nov 2008
Thank you thank you thank you. I sat for 2 hours trying to do what you done
in 2 mins.

"Ken Sheridan" wrote:

> Set the ControlSource property of the text box to:
>
> =DCount("*","[Additional Jobs]","[JobID] = " & [JobID])
>
> Where JobID is the primary key of the Job Details table and the
> corresponding foreign key column in the Additional Jobs table. If JobID is
> text rather than a number wrap the value in quotes characters like so:
>
> =DCount("*","[Additional Jobs]","[JobID] = """ & [JobID] & """")
>
> If you want to include the main job in the count as well as the additional
> jobs then add 1:
>
> =DCount("*","[Additional Jobs]","[JobID] = " & [JobID])+1
>
> You could also, if you wish, include a continuous or datasheet view subform
> based on the Additional Jobs in the main form provided this is in single form
> view, linked on JobID. That way you'd see the additional jobs for the
> current job listed, and be able to add, delete or edit additional jobs all
> through the one form/subform.
>
> Ken Sheridan
> Stafford, England
>
> "DH010010" wrote:
>
> > i have two tables one "job details" and another "additional jobs". the "job
> > details" table holds all the main information customers name and what job is
> > to be carried out ect. if they would like additional jobs they are stored in
> > the "additional Jobs" table linked to "job details". now in the form that
> > enters and displays this information i have an unbound box which i would
> > like to display the total number of jobs to be complete for that customer.
> >
> > anyhelp on this would be great.

>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to show a count of Unique IDs in a Pivot Table Dave K Microsoft Excel Discussion 2 26th Jun 2009 04:01 PM
Show Count of items from a form Conference Queen Microsoft Access 2 3rd Oct 2008 02:44 PM
Getting a pivot table to show the count of blank cells in a worksh =?Utf-8?B?Um9iYm8=?= Microsoft Excel Misc 1 21st Nov 2006 02:56 AM
How to show the record count of the table used on a form ? barret bonden Microsoft Access Forms 1 10th Sep 2006 10:48 PM
COUNT INFORMATION IN COLUMN B ONLY IF A1 MATCHES K1 COUNT THAT CE. =?Utf-8?B?d2l0Y2hjYXQ5OA==?= Microsoft Excel Worksheet Functions 1 4th Feb 2005 01:38 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:15 AM.