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!

Add Field that Counts Records with the same name

Status
Not open for further replies.

pcolvin

Technical User
Oct 17, 2008
22
US
I have an MS Access 2007 form that has unique ID numbers but has an additional identification field that can be the same for multiple records.

For example, each record has an order number and a client number. The order number is unique, but the client number is used for every order made by that client.

I want to add a field that shows how many times a client has placed an order.

i.e

Order 1000
Client 5555
Count ?

Order 1001
Client 5555
Count ?

Order 1002
Client 5555
Count ?

For this example, the count should be 3. I have tried doing this using the count feature in a query, but every time I do that the forms locks itself from being editted.

THANKS!!!
 
Are you using a combo box for entering your client numbers? If so, you can base your Row Source on a query that joins clients to orders with a group by Client fields and count orders. Make sure your query includes all records from the Client table.

Duane
Hook'D on Access
MS Access MVP
 
No, the client number is a plain text box field.
 
Why not make your interface better by using a combo box? This will allow you to create a column in the combo box that includes the count of orders.

If you can't figure this out, come back with table and field names.

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top