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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Transaction Count assistance please

Status
Not open for further replies.

perrydaniel

Technical User
Apr 27, 2004
56
IE
I have two tables.

1. ClientTable (ClientId key, autonumber)
2. RequirementTable (RequirementID key, autonumber)

The Client can have many requirements
Example
Client 1 John
Requirement 1 Tea
Requirement 2 Coffee

Client 2 Peter
Requirement 3 Tea

What I would like is Client 2s requirements to automatically go back to 1 each time. I am finding that the increment is ongoing, rather than starting from 1 for each new client. I presume that it is because i have autonumber as the datatype for REQUIREMENTID, but what should I use, and how do I make the requirementID increment by 1 for each new client?

Many thanks

Hope I have explained myself well enough

Perry
 
I don't believe this can be done automatically. You would have to do it through code. You would have to pull Max of teh RequirementID for the Client ID and then increment it by 1 then add the record. You would want to change the RequirementID from AutoNumber to maybe and Integer type.



Hope this helps.

OnTheFly
 
I don't believe this can be done automatically. You would have to do it through code. You would have to pull Max of the RequirementID for the Client ID and then increment it by 1 then add the record. You would want to change the RequirementID from AutoNumber to maybe and Integer type.



Hope this helps.

OnTheFly
 
OntheFly,

Dont have any code experience, could you walk me through! Or it that too much work

Peryr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top