Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

field counter, display no. of occurences in a table on a form

Status
Not open for further replies.

tonyx666

MIS
Apr 13, 2006
214
GB
hi,

in my table i have a customer id number.

each job will have one customer id number.. and customers will have many jobs to their id

i simply want to display on my form the number of times that customer's id has appeared in my bookings table.

eg.. a customer has used our services 25 times.. (so obviously their customer id is found 25 times in the booking table as a foreign key)

so can i just place a control on my form that displays this value (i presume it is some kind of counter)..

so i will know on my customer form how many times they have been included in a booking record

London Heathrow Cars
 
ok i have this

"intX"=DCount("[customerid]","bookings")

so far


customerid is the field i want to count.. bookings is the table i want to search through.. but i want to search through the 'customer' field aswell..

how can i change the code to do that

also do i put it in the control source of the textbox??

London Heathrow Cars
 
Perhaps this ?
=DCount("*","bookings","customerid=" & [customerid])

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top