troubleshooting Question

Create Incremental Count and Reset Counter for Field Change in Access

Avatar of Anthony6890
Anthony6890 asked on
Microsoft AccessVBA
14 Comments3 Solutions5154 ViewsLast Modified:
Hi,

I'm trying to figure out a way of adding a row count to a query that adds a sequential row number for each change in a subsequent field.

For example, let says I have a table of values where the employee ID is the main lookup value.  That value is linked to a dependent to determine who the dependent is.  I'm making a table with this data that lists the employee's number followed by the dependent's ID number.  I want the dependent's to become numbered, 1,2,3, and etc until the employee's ID number changes.  I then want the counter to reset.  Is there a way that I can accomplish this?

Here is an example of what I am looking for...

Employee_ID                   Dependent_ID                  Dep_Num
ABC123                             321zax                               1
ABC123                             221zax                               2
ABC123                             721zax                               3
GHI555                              899tti                                 1

Does anyone know how I can accomplish this?

-Anthony
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 3 Answers and 14 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 14 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros